aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/strings/replace.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/strings/replace.go')
-rw-r--r--libgo/go/strings/replace.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgo/go/strings/replace.go b/libgo/go/strings/replace.go
index ace0b8d..ccab1fb 100644
--- a/libgo/go/strings/replace.go
+++ b/libgo/go/strings/replace.go
@@ -26,6 +26,8 @@ type replacer interface {
// NewReplacer returns a new Replacer from a list of old, new string
// pairs. Replacements are performed in the order they appear in the
// target string, without overlapping matches.
+//
+// NewReplacer panics if given an odd number of arguments.
func NewReplacer(oldnew ...string) *Replacer {
if len(oldnew)%2 == 1 {
panic("strings.NewReplacer: odd argument count")