(name string, style string, idUppercase bool)
| 65 | } |
| 66 | |
| 67 | func SetJSONCaseStyle(name string, style string, idUppercase bool) string { |
| 68 | switch style { |
| 69 | case "camel": |
| 70 | return toJsonCamelCase(name, idUppercase) |
| 71 | case "pascal": |
| 72 | return toPascalCase(name) |
| 73 | case "snake": |
| 74 | return toSnakeCase(name) |
| 75 | default: |
| 76 | panic(fmt.Sprintf("unsupported JSON tags case style: '%s'", style)) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | var camelPattern = regexp.MustCompile("[^A-Z][A-Z]+") |
| 81 |
no test coverage detected