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

Function EnumValueName

internal/codegen/golang/enum.go:50–57  ·  view source on GitHub ↗

EnumValueName removes all non ident symbols (all but letters, numbers and underscore) and converts snake case ident to camel case.

(value string)

Source from the content-addressed store, hash-verified

48// EnumValueName removes all non ident symbols (all but letters, numbers and
49// underscore) and converts snake case ident to camel case.
50func 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
59func titleFirst(s string) string {
60 r := []rune(s)

Callers

nothing calls this directly

Calls 3

EnumReplaceFunction · 0.85
titleFirstFunction · 0.85
JoinMethod · 0.45

Tested by

no test coverage detected