On Thu, Jul 27, 2017 at 09:36:31AM -0700, howardcs...@gmail.com wrote:
> https://golang.org/pkg/reflect/#DeepEqual
>
> "Pointer values are deeply equal if they are equal using Go's == operator
> or if they point to deeply equal values."
>
> By the rules described here, the fact that both
https://golang.org/pkg/reflect/#DeepEqual
"Pointer values are deeply equal if they are equal using Go's == operator
or if they point to deeply equal values."
By the rules described here, the fact that both pointers have the same
value means it does not even NEED to check what they point to, so
On Wed, Jul 26, 2017 at 04:55:39PM +, Jan Mercl wrote:
> On Wed, Jul 26, 2017 at 6:37 PM Julian Andres Klode
> wrote:
>
> > Is there an existing alternative to reflect.DeepEqual() that also
> respects the shape of the arguments? For example, the following tests fail:
>
>
On Wed, Jul 26, 2017 at 6:37 PM Julian Andres Klode
wrote:
> Is there an existing alternative to reflect.DeepEqual() that also
respects the shape of the arguments? For example, the following tests fail:
a and b _are_ of equal shape and contain equal values:
Is there an existing alternative to reflect.DeepEqual() that also respects
the shape of the arguments? For example, the following tests fail:
type List struct {
next *List
}
func TestList(t *testing.T) {
a := {}
a.next = a
b := {a}
if reflect.DeepEqual(a, b) {
t.Error("Lists are equal")
}
}