mirror of
https://github.com/juanfont/headscale.git
synced 2026-09-18 14:32:01 +09:00
all: adopt maps and cmp helpers
This commit is contained in:
@@ -36,9 +36,7 @@ func usernameAndIDFromFlag(cmd *cobra.Command) (uint64, string, error) {
|
||||
|
||||
// Normalise unset/negative identifiers to 0 so the uint64
|
||||
// conversion does not produce a bogus large value.
|
||||
if identifier < 0 {
|
||||
identifier = 0
|
||||
}
|
||||
identifier = max(identifier, 0)
|
||||
|
||||
return uint64(identifier), username, nil //nolint:gosec // identifier is clamped to >= 0 above
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user