davecgh / go-spew

Implements a deep pretty printer for Go data structures to aid in debugging
ISC License
6.05k stars 364 forks source link

How to dump the contents of a pointer? #82

Closed corpix closed 6 years ago

corpix commented 6 years ago

If you spew.Dump(some-pointer) then you will see something like this:

(*lua.LTable)(0xc4202f1ec0)(table: 0xc4202f1ec0)

It is unclear, how to make it dump the whole structure and not just type name + address?

davecgh commented 6 years ago

It will do so automatically unless that type also has a stringer on it. In that case you can set the spew.Config.DisablePoinerMethods = true to avoid invoking them.