all: adopt maps and cmp helpers

This commit is contained in:
Kristoffer Dalby
2026-06-16 08:30:16 +00:00
parent ac725f27e4
commit 27468f944b
7 changed files with 28 additions and 69 deletions
+1 -3
View File
@@ -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
}