MCPcopy
hub / github.com/spf13/pflag / replaceSeparators

Function replaceSeparators

flag_test.go:735–742  ·  view source on GitHub ↗
(name string, from []string, to string)

Source from the content-addressed store, hash-verified

733}
734
735func replaceSeparators(name string, from []string, to string) string {
736 result := name
737 for _, sep := range from {
738 result = strings.Replace(result, sep, to, -1)
739 }
740 // Type convert to indicate normalization has been done.
741 return result
742}
743
744func wordSepNormalizeFunc(f *FlagSet, name string) NormalizedName {
745 seps := []string{"-", "_"}

Callers 2

wordSepNormalizeFuncFunction · 0.85
aliasAndWordSepFlagNamesFunction · 0.85

Calls 1

ReplaceMethod · 0.65

Tested by

no test coverage detected