policy/v2: rewrite tag-name first-letter check via De Morgan

This commit is contained in:
Kristoffer Dalby
2026-05-13 12:05:47 +00:00
parent d32d91d9fb
commit 48e22ab769
+1 -1
View File
@@ -542,7 +542,7 @@ func (t *Tag) Validate() error {
}
first := rest[0]
if !((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z')) {
if (first < 'a' || first > 'z') && (first < 'A' || first > 'Z') {
return ErrTagNameMustStartWithLetter
}