EnumValueName removes all non ident symbols (all but letters, numbers and underscore) and converts snake case ident to camel case.
(value string)
| 48 | // EnumValueName removes all non ident symbols (all but letters, numbers and |
| 49 | // underscore) and converts snake case ident to camel case. |
| 50 | func EnumValueName(value string) string { |
| 51 | parts := strings.Split(EnumReplace(value), "_") |
| 52 | for i, part := range parts { |
| 53 | parts[i] = titleFirst(part) |
| 54 | } |
| 55 | |
| 56 | return strings.Join(parts, "") |
| 57 | } |
| 58 | |
| 59 | func titleFirst(s string) string { |
| 60 | r := []rune(s) |
nothing calls this directly
no test coverage detected