camelCase converts a string to camelCase, which is useful for turning Go field names to JSON keys.
(s string)
| 1830 | |
| 1831 | // camelCase converts a string to camelCase, which is useful for turning Go field names to JSON keys. |
| 1832 | func camelCase(s string) string { |
| 1833 | if len(s) == 0 { |
| 1834 | return "" |
| 1835 | } |
| 1836 | if len(s) == 1 { |
| 1837 | return strings.ToLower(s) |
| 1838 | } |
| 1839 | return strings.ToLower(s[0:1]) + s[1:] |
| 1840 | } |
| 1841 | |
| 1842 | type exportable interface { |
| 1843 | ExportData([]string) map[string]any |
no outgoing calls