(s string)
| 832 | } |
| 833 | |
| 834 | func 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 | |
| 851 | func typeByIndex(t reflect.Type, index []int) reflect.Type { |
| 852 | for _, i := range index { |