MCPcopy Create free account
hub / github.com/blues/note / isValidTag

Function isValidTag

jsonxt/encode.go:834–849  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

832}
833
834func isValidTag(s string) bool {
835 if s == "" {
836 return false
837 }
838 for _, c := range s {
839 switch {
840 case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c):
841 // Backslash and quote chars are reserved, but
842 // otherwise any punctuation chars are allowed
843 // in a tag name.
844 case !unicode.IsLetter(c) && !unicode.IsDigit(c):
845 return false
846 }
847 }
848 return true
849}
850
851func typeByIndex(t reflect.Type, index []int) reflect.Type {
852 for _, i := range index {

Callers 1

typeFieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected