(s string)
| 43 | } |
| 44 | |
| 45 | func toCamel(s string) string { |
| 46 | str := xstrings.ToCamelCase(s) |
| 47 | |
| 48 | name := strings.ToUpper(str) |
| 49 | if _, ok := peculiarNouns[name]; ok { |
| 50 | return name |
| 51 | } |
| 52 | |
| 53 | l := len(str) |
| 54 | for k, v := range peculiarNouns { |
| 55 | nl := len(v) |
| 56 | if l > nl { |
| 57 | if str[l-nl:] == v { |
| 58 | str = str[:l-nl] + k |
| 59 | break |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | if str == "_ID" { // special case for table column ID |
| 65 | str = "ID" |
| 66 | } |
| 67 | |
| 68 | return str |
| 69 | } |
| 70 | |
| 71 | func firstLetterToLower(str string) string { |
| 72 | if len(str) == 0 { |
no outgoing calls