mirror of
https://github.com/juanfont/headscale.git
synced 2026-07-07 16:40:21 +09:00
policy/v2: rewrite tag-name first-letter check via De Morgan
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user