* 'Axel Wagner' via golang-nuts <
golan...@googlegroups.com> [200917 12:05]:
> I think you might've intended this, which does indeed print true:
> type S []S
> var a, b S
> a, b = S{0: b}, S{0: a}
> fmt.Println(reflect.DeepEqual(a, b))
I was guessing he meant:
type S []S
var a, b S
a = S{0: b}
b = S{0: a}
a[0] = b
fmt.Println(reflect.DeepEqual(a, b))
which also returns true, but for a slightly different reason; check out
the following for each of the two cases:
fmt.Printf("a[0] == nil: %t, b[0] == nil: %t\n", a[0] == nil, b[0] == nil)
...Marvin