MCPcopy
hub / github.com/operator-framework/operator-sdk / prefixLines

Function prefixLines

internal/helm/internal/diff/diff.go:52–61  ·  view source on GitHub ↗
(s, prefix string)

Source from the content-addressed store, hash-verified

50}
51
52func prefixLines(s, prefix string) string {
53 var buf bytes.Buffer
54 lines := strings.Split(s, "\n")
55 ls := regexp.MustCompile("^")
56 for _, line := range lines[:len(lines)-1] {
57 buf.WriteString(ls.ReplaceAllString(line, prefix))
58 buf.WriteString("\n")
59 }
60 return buf.String()
61}

Callers 1

GenerateFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected