MCPcopy Index your code
hub / github.com/devspace-sh/devspace / String

Function String

pkg/devspace/services/proxycommands/rewrite.go:49–51  ·  view source on GitHub ↗

String returns a transformer that replaces all instances of old with new. Unlike strings.Replace, empty old values don't match anything.

(old, new string)

Source from the content-addressed store, hash-verified

47// String returns a transformer that replaces all instances of old with new.
48// Unlike strings.Replace, empty old values don't match anything.
49func String(old, new string) Transformer {
50 return Bytes([]byte(old), []byte(new))
51}
52
53// Transform implements golang.org/x/text/transform#Transformer
54func (t Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {

Callers 1

NewRewriterFunction · 0.70

Calls 1

BytesFunction · 0.85

Tested by

no test coverage detected