mirror of
https://github.com/juanfont/headscale.git
synced 2026-09-17 14:02:07 +09:00
policy/v2: rewrite tag-name first-letter check via De Morgan
This commit is contained in:
@@ -562,7 +562,7 @@ func (t *Tag) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
first := rest[0]
|
first := rest[0]
|
||||||
if !((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z')) {
|
if (first < 'a' || first > 'z') && (first < 'A' || first > 'Z') {
|
||||||
return ErrTagNameMustStartWithLetter
|
return ErrTagNameMustStartWithLetter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user