We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f33b67b commit 61e0cacCopy full SHA for 61e0cac
src/strings/replace.go
@@ -26,6 +26,8 @@ type replacer interface {
26
// NewReplacer returns a new Replacer from a list of old, new string
27
// pairs. Replacements are performed in the order they appear in the
28
// target string, without overlapping matches.
29
+//
30
+// NewReplacer panics if given an odd number of arguments.
31
func NewReplacer(oldnew ...string) *Replacer {
32
if len(oldnew)%2 == 1 {
33
panic("strings.NewReplacer: odd argument count")
0 commit comments