davecgh / go-spew

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

Ability to suppress fields from display #120

Open klaxxon opened 4 years ago

klaxxon commented 4 years ago

This is my first pull request. Just the config file is what I am asking for you to consider.

Using your package and my structs contain a lot of management/housekeeping sub-structs which clutter up the output. I needed a way to say "don't show any 'config' structs" or of the type "TempData".

Creates and maintains a map of strings for field names and types. Two methods to add the name or type to these maps and continue statements in your recursive output builder to skip these fields if they are found.

Thank You!

ptrcnull commented 2 years ago

IMHO it would be simpler to just export the field in config struct and get rid of the IgnoreFieldBy(...) methods.