MCPcopy Create free account
hub / github.com/goadesign/goa / KebabCase

Function KebabCase

codegen/funcs.go:246–253  ·  view source on GitHub ↗

KebabCase produces the kebab-case version of the given CamelCase string.

(name string)

Source from the content-addressed store, hash-verified

244
245// KebabCase produces the kebab-case version of the given CamelCase string.
246func KebabCase(name string) string {
247 name = SnakeCase(name)
248 ln := len(name)
249 if name[ln-1] == '_' {
250 name = name[:ln-1]
251 }
252 return strings.ReplaceAll(name, "_", "-")
253}
254
255// WrapText produces lines with text capped at maxChars
256// it will keep words intact and respects newlines.

Callers 5

BuildCommandDataFunction · 0.92
BuildSubcommandDataFunction · 0.92
NewFlagDataFunction · 0.92
generateExampleFunction · 0.92
TestKebabCaseFunction · 0.85

Calls 1

SnakeCaseFunction · 0.85

Tested by 1

TestKebabCaseFunction · 0.68