1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 22:42:50 -05:00

core: apply gopls automatic modernizers (#1198)

This commit is contained in:
Marcus Ramberg
2025-12-29 03:48:56 +01:00
committed by GitHub
parent c281bf3b53
commit ae82716afa
16 changed files with 71 additions and 98 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"fmt"
"os/exec"
"slices"
"strings"
)
@@ -36,13 +37,7 @@ func checkSystemdServiceEnabled(serviceName string) (string, bool, error) {
if err != nil {
knownStates := []string{"disabled", "masked", "masked-runtime", "not-found", "enabled", "enabled-runtime", "static", "indirect", "alias"}
isKnownState := false
for _, known := range knownStates {
if stateStr == known {
isKnownState = true
break
}
}
isKnownState := slices.Contains(knownStates, stateStr)
if !isKnownState {
return stateStr, false, fmt.Errorf("systemctl is-enabled failed: %w (output: %s)", err, stateStr)