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 tests of the reflect package still pass. Is it some kind of an optimization? On Saturday, November 14, 2020 at 9:43:38 PM UTC+1 kortschak wrote: > Or github.com/kortschak/utter </shameless-self-plug>. > > This package does an arguably better job at dealing with self- > referencing structures. > > On Sat, 2020-11-14 at 03:52 -0800, twp...@gmail.com wrote: > > > My use case is that I want to pretty print in-memory objects for > > debug purposes during testing, and one of the features would be to > > point out such cycles as this. > > > > Consider using an existing library for this, for example: > > https://github.com/sanity-io/litter > > https://github.com/davecgh/go-spew > > > > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/43832bba-7b42-4735-ab32-ee10805b27bbn%40googlegroups.com.