MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / IndentString

Function IndentString

pkg/util/utilfn/utilfn.go:739–752  ·  view source on GitHub ↗
(indent string, str string)

Source from the content-addressed store, hash-verified

737}
738
739func IndentString(indent string, str string) string {
740 splitArr := strings.Split(str, "\n")
741 var rtn strings.Builder
742 for _, line := range splitArr {
743 if line == "" {
744 rtn.WriteByte('\n')
745 continue
746 }
747 rtn.WriteString(indent)
748 rtn.WriteString(line)
749 rtn.WriteByte('\n')
750 }
751 return rtn.String()
752}
753
754func SliceIdx[T comparable](arr []T, elem T) int {
755 for idx, e := range arr {

Callers 2

generateTypesFileFunction · 0.92
generateWaveEventFileFunction · 0.92

Calls 2

WriteStringMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected