Often on my team, Go programmers (particularly new ones) simply want full
visibility into a data structure when debugging. For those who aren't
familiar with pointers, seeing a hexadecimal number show up in a log can be
really frustrating. I usually point them
to https://github.com/davecgh/go-spew
or https://github.com/sanity-io/litter. Although they can be heavy-handed
with their unsafe package dependency and fancy formatting, they are
indispensable when debugging data structures like syntax trees.
I wonder it's worthwhile to add this functionality to the reflect package,
and take advantage of the functionality that DeepEquals uses. I'm not a fan
of Dump functions that just take an io.Writer. Why not add a named type for
interface{} or reflect.Value called reflect.Deep, which implements
fmt.Formatter? Then, packages that use fmt will have more precise control
over formatting, and we can maybe add special formatting directives for
reflect.Deep.
What do you think?
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/6f1c9bea-c2b6-4a7c-a37e-ef3abb8a3dd2n%40googlegroups.com.