Hi,
is there a way to detect the cyclic reference in the following example
somehow? Either via reflection or by other means? My understanding is that
slices cannot be compared with == (unless to nil), or used as keys in maps.
Is there a different way?
l := []interface{}{"foo"}
l[0] = l
fmt.Pri
:
>>
>>> If the slice is empty, it doesn't reference anything.
>>> If it is not empty, &x[0] can be used to identify the slice (potentially
>>> also using len/cap, if it's interesting).
>>>
>>> On Tue, Nov 10, 2020 at 4:11 AM arpad r
Thanks a lot for the help! Seems like I could sort it out based on the
reflect.DeepEqual code. Do you have any testing tips?
Out of general curiosity, I am wondering why the type is part of the key
for the visited map here: https://golang.org/src/reflect/deepequal.go#L15.
If I remove it, the te