1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-24 04:55:07 +00:00

refactor: fix modernize lint issues (#539)

This commit is contained in:
Oleksandr Redko
2026-03-05 14:46:12 +02:00
committed by GitHub
parent fc006e32be
commit 603df79a01
7 changed files with 17 additions and 48 deletions

View File

@@ -261,10 +261,10 @@ func scutilProxyEnabled(out, key string) bool {
func scutilProxyValue(out, key string) string {
prefix := key + " :"
for _, line := range strings.Split(out, "\n") {
for line := range strings.Lines(out) {
line = strings.TrimSpace(line)
if strings.HasPrefix(line, prefix) {
return strings.TrimSpace(strings.TrimPrefix(line, prefix))
if after, ok := strings.CutPrefix(line, prefix); ok {
return strings.TrimSpace(after)
}
}
return ""