-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
What version of Go are you using (go version)?
go1.10.1
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
amd64
darwin
What did you do?
https://play.golang.org/p/oB5SCKv4LUx
r := strings.NewReplacer("aaa", "xxx", "bbbaaa", "yyy")
fmt.Println(r.Replace("bbbaaa")) // yyyWhat did you expect to see?
I expected Replace to return bbbxxx.
The documentation says:
Replacements are performed in order, without overlapping matches.
I expect the aaa->xxx replacement to happen first so the second replacement bbbaaa->yyy shouldn't happen.
What did you see instead?
yyy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.