MCPcopy
hub / github.com/docker/compose / preferredIndentationStr

Function preferredIndentationStr

cmd/compose/viz.go:95–105  ·  view source on GitHub ↗

preferredIndentationStr returns a single string given the indentation preference

(size int, useSpace bool)

Source from the content-addressed store, hash-verified

93
94// preferredIndentationStr returns a single string given the indentation preference
95func preferredIndentationStr(size int, useSpace bool) (string, error) {
96 if size < 0 {
97 return "", fmt.Errorf("invalid indentation size: %d", size)
98 }
99
100 indentationStr := "\t"
101 if useSpace {
102 indentationStr = " "
103 }
104 return strings.Repeat(indentationStr, size), nil
105}

Callers 2

vizCommandFunction · 0.85

Calls

no outgoing calls

Tested by 1