mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-24 23:36:49 +09:00
all: adopt strings, errors, and os helpers
This commit is contained in:
1 parent
27468f944b
commit
4f4e95fc80
7 files changed
+19
-44
No files matched your search
@@ -162,10 +162,10 @@ func credentialsFromConfig() (string, string, bool) {
|
||||
return "", "", false
|
||||
}
|
||||
|
||||
parts := strings.SplitN(string(decoded), ":", 2)
|
||||
if len(parts) != 2 {
|
||||
user, pass, ok := strings.Cut(string(decoded), ":")
|
||||
if !ok {
|
||||
return "", "", false
|
||||
}
|
||||
|
||||
return parts[0], parts[1], true
|
||||
return user, pass, true
|
||||
}
|
||||
Reference in new issue
Block a user