snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s

This commit is contained in:
upstream-mirror
2026-09-15 21:27:46 +05:00
commit ce933d1277
538 changed files with 46504 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package internal
import "strings"
// Indent indents all lines in the given string with a given prefix.
func Indent(s, prefix string) string {
endsWithNewline := strings.HasSuffix(s, "\n")
split := strings.Split(s, "\n")
for i, ss := range split {
split[i] = prefix + ss
}
joined := strings.Join(split, "\n")
if endsWithNewline {
joined += "\n"
}
return joined
}