-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Milestone
Description
The underlying problem is that the underlying nat type doesn't allocate a backing slice for the zero value in some initialization sequences, which causes reflect.DeepEqual to return false for equal big.Int values.
Either big.nat needs to be changed to always drop backing slices when setting to zero, always allocate backing slices, or the argument that zero-length slices and zero-length nil slices are different needs more thought. The current default answer is pedantically correct but not programmer friendly.
See #12918
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version go1.10.2 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
x86_64
What did you do?
https://play.golang.org/p/CUcu_oCBILj
What did you expect to see?
true
What did you see instead?
false