A previous discussion of this was quite long (89 posts) - maybe start there: https://groups.google.com/d/msg/golang-nuts/ajXzEM6lqJI/wbTPh2TmAwAJ
On Thursday, August 2, 2018 at 1:21:15 PM UTC-4, Andrey Tcherepanov wrote: > > The following code does not compile. What was *rationale* behind slices > being excluded from being nicely comparable by == like anything else ? > > package main > > import ( > "fmt" > ) > > func main() { > var a, b []byte > > fmt.Println("equals?", a == b) > } > > Slices are _excluded_ from deep comparison by stating "Other values - > numbers, bools, strings, and channels - are deeply equal if they are equal > using Go's == operator." (from documentation of reflect.DeepEqual() > <http://golang.org/pkg/reflect/#DeepEqual> ). > > > Sorry if it is FAQ of some sort, but I seems cannot find an answer to > "why". > > Thank you very much, > Andrey > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.