Skip to content

Commit

Permalink
more lint
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Williams <[email protected]>
  • Loading branch information
ywwg committed Dec 4, 2023
1 parent 2038038 commit fd95be1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions model/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,16 @@ func (ln LabelName) IsValid() bool {
return false
}
switch NameValidationScheme {
case LegacyValidation:
for i, b := range ln {
if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || (b >= '0' && b <= '9' && i > 0)) {
return false
}
case LegacyValidation:
for i, b := range ln {
if !((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_' || (b >= '0' && b <= '9' && i > 0)) {
return false
}
case UTF8Validation:
return utf8.ValidString(string(ln))
default:
panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
}
case UTF8Validation:
return utf8.ValidString(string(ln))
default:
panic(fmt.Sprintf("Invalid name validation scheme requested: %d", NameValidationScheme))
}
return true
}
Expand Down

0 comments on commit fd95be1

Please sign in to comment.