MCPcopy Create free account
hub / github.com/bytebase/bytebase / toSnakeCase

Function toSnakeCase

backend/api/v1/acl.go:551–555  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

549var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])")
550
551func toSnakeCase(str string) string {
552 snake := matchFirstCap.ReplaceAllString(str, "${1}_${2}")
553 snake = matchAllCap.ReplaceAllString(snake, "${1}_${2}")
554 return strings.ToLower(snake)
555}

Callers 2

TestToSnakeCaseFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestToSnakeCaseFunction · 0.68