MCPcopy Index your code
hub / github.com/go-python/gopy / toSnakeCase

Function toSnakeCase

bind/utils.go:305–310  ·  view source on GitHub ↗

toSnakeCase converts the provided string to snake_case. Based on https://gist.github.com/stoewer/fbe273b711e6a06315d19552dd4d33e6

(input string)

Source from the content-addressed store, hash-verified

303// toSnakeCase converts the provided string to snake_case.
304// Based on https://gist.github.com/stoewer/fbe273b711e6a06315d19552dd4d33e6
305func toSnakeCase(input string) string {
306 output := rxMatchFirstCap.ReplaceAllString(input, "${1}_${2}")
307 output = rxMatchAllCap.ReplaceAllString(output, "${1}_${2}")
308 output = strings.ReplaceAll(output, "-", "_")
309 return strings.ToLower(output)
310}

Callers 5

genVarGetterMethod · 0.85
genVarSetterMethod · 0.85
genFuncSigMethod · 0.85
genStructMemberGetterMethod · 0.85
genStructMemberSetterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected