MCPcopy Create free account
hub / github.com/segmentio/encoding / isValidTag

Function isValidTag

json/codec.go:879–896  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

877}
878
879func isValidTag(s string) bool {
880 if s == "" {
881 return false
882 }
883 for _, c := range s {
884 switch {
885 case strings.ContainsRune("!#$%&()*+-./:;<=>?@[]^_{|}~ ", c):
886 // Backslash and quote chars are reserved, but
887 // otherwise any punctuation chars are allowed
888 // in a tag name.
889 default:
890 if !unicode.IsLetter(c) && !unicode.IsDigit(c) {
891 return false
892 }
893 }
894 }
895 return true
896}
897
898func emptyFuncOf(t reflect.Type) emptyFunc {
899 switch t {

Callers 1

appendStructFieldsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…