MCPcopy Create free account
hub / github.com/box-cli-maker/box-cli-maker / indentBox

Function indentBox

examples/box_styles/main.go:10–20  ·  view source on GitHub ↗
(s string, spaces int)

Source from the content-addressed store, hash-verified

8)
9
10func indentBox(s string, spaces int) string {
11 pad := strings.Repeat(" ", spaces)
12 lines := strings.Split(s, "\n")
13 for i, l := range lines {
14 if len(l) == 0 {
15 continue
16 }
17 lines[i] = pad + l
18 }
19 return strings.Join(lines, "\n")
20}
21
22func main() {
23 styles := []box.BoxStyle{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected