-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.14.4 linux/amd64
Does this issue reproduce with the latest release?
Yes
What did you do?
package main
import (
"bytes"
"fmt"
)
func main() {
old := []byte("")
b := bytes.ReplaceAll(old, []byte("oink"), []byte("moo"))
fmt.Println(old == nil)
fmt.Println(b == nil)
}What did you expect to see?
false
true
the call of bytes.ReplaceAll on an empty slice should also return an empty slice. However, it returns nil
What did you see instead?
false
false
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.