MCPcopy Create free account
hub / github.com/conforma/cli / Indent

Function Indent

acceptance/snaps/indent.go:21–27  ·  view source on GitHub ↗
(str string, n int)

Source from the content-addressed store, hash-verified

19import "strings"
20
21func Indent(str string, n int) string {
22 idnt := strings.Repeat(" ", n)
23
24 lines := strings.Split(str, "\n")
25
26 return idnt + strings.TrimSuffix(strings.Join(lines, "\n"+idnt), "\n"+idnt)
27}

Callers 3

setupKeysFunction · 0.92
TestIndentFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestIndentFunction · 0.68