MCPcopy
hub / github.com/spf13/cobra / forceMultiLine

Function forceMultiLine

doc/util.go:41–46  ·  view source on GitHub ↗

Temporary workaround for yaml lib generating incorrect yaml with long strings that do not contain \n.

(s string)

Source from the content-addressed store, hash-verified

39// Temporary workaround for yaml lib generating incorrect yaml with long strings
40// that do not contain \n.
41func forceMultiLine(s string) string {
42 if len(s) > 60 && !strings.Contains(s, "\n") {
43 s += "\n"
44 }
45 return s
46}
47
48type byName []*cobra.Command
49

Callers 2

GenYamlCustomFunction · 0.85
genFlagResultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected