From c79fd5c1688257c818dc0fa78816b6be2599f61a Mon Sep 17 00:00:00 2001 From: Roy Han Date: Wed, 29 May 2024 12:22:36 -0700 Subject: [PATCH] Reincluding Numbers --- types/model/name.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/model/name.go b/types/model/name.go index cfdc19dd2..8eaf54873 100644 --- a/types/model/name.go +++ b/types/model/name.go @@ -321,7 +321,7 @@ func isValidPart(kind partKind, s string) bool { } for i, c := range s { if i == 0 { - if !isLetterorUnderscore(c) { + if !isAlphanumericOrUnderscore(c) { return false } continue @@ -337,7 +337,7 @@ func isValidPart(kind partKind, s string) bool { return false } default: - if !isLetterorUnderscore(c) { + if !isAlphanumericOrUnderscore(c) { return false } } @@ -345,8 +345,8 @@ func isValidPart(kind partKind, s string) bool { return true } -func isLetterorUnderscore(c rune) bool { - return unicode.IsLetter(c) || c == '_' +func isAlphanumericOrUnderscore(c rune) bool { + return unicode.IsLetter(c) || unicode.IsDigit(c) || c == '_' } func cutLast(s, sep string) (before, after string, ok bool) {