MCPcopy Index your code
hub / github.com/coder/coder / pascal

Function pascal

scripts/apikeyscopesgen/main.go:150–161  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

148}
149
150func pascal(s string) string {
151 // Replace non-identifier separators with spaces, then Title-case and strip.
152 s = strings.ReplaceAll(s, "_", " ")
153 s = strings.ReplaceAll(s, "-", " ")
154 s = strings.ReplaceAll(s, ":", " ")
155 s = strings.ReplaceAll(s, ".", " ")
156 words := strings.Fields(s)
157 for i := range words {
158 words[i] = strings.ToUpper(words[i][:1]) + words[i][1:]
159 }
160 return strings.Join(words, "")
161}

Callers 1

constNameForScopeFunction · 0.85

Calls 1

FieldsMethod · 0.65

Tested by

no test coverage detected