MCPcopy Create free account
hub / github.com/github/gh-aw / firstForbiddenCharInModelToken

Function firstForbiddenCharInModelToken

pkg/workflow/model_identifier.go:122–129  ·  view source on GitHub ↗

firstForbiddenCharInModelToken returns the first character in s that is not in [A-Za-z0-9_.-], or 0 if all characters are allowed. Used for model tokens (V-MAF-006).

(s string)

Source from the content-addressed store, hash-verified

120// [A-Za-z0-9_.-], or 0 if all characters are allowed.
121// Used for model tokens (V-MAF-006).
122func firstForbiddenCharInModelToken(s string) rune {
123 for _, r := range s {
124 if !isAlpha(r) && !isDigit(r) && r != '_' && r != '.' && r != '-' {
125 return r
126 }
127 }
128 return 0
129}
130
131// firstForbiddenCharInBareName returns the first character in s that is not in
132// [A-Za-z0-9._-], or 0 if all characters are allowed.

Callers 1

validateModelTokenFunction · 0.85

Calls 2

isAlphaFunction · 0.85
isDigitFunction · 0.85

Tested by

no test coverage detected