MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / toCamelInitCase

Function toCamelInitCase

internal/codegen/golang/field.go:99–113  ·  view source on GitHub ↗
(name string, initUpper bool)

Source from the content-addressed store, hash-verified

97}
98
99func toCamelInitCase(name string, initUpper bool) string {
100 out := ""
101 for i, p := range strings.Split(name, "_") {
102 if !initUpper && i == 0 {
103 out += p
104 continue
105 }
106 if p == "id" {
107 out += "ID"
108 } else {
109 out += strings.Title(p)
110 }
111 }
112 return out
113}
114
115func toJsonCamelCase(name string, idUppercase bool) string {
116 out := ""

Callers 2

toCamelCaseFunction · 0.85
toPascalCaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected