go-spew
go-spew copied to clipboard
Feature Request: Hide certain types in output
I'm working with the gorilla muxer (https://github.com/gorilla/mux), and am trying to debug my routes, and am getting massive outputs that prevent me from seeing the bits I'm interested in.
A sample struct is like the following:
(*http.Route)(0xc04215a240)({
parent: (*http.Router)(0xc04200a7e0)({
// -- a giant struct that is too big for it's own good
}),
handler: (*http.JSONHandler)(0xc042004118)({
H: (func(context.Context, http.ResponseWriter, *http.Request) (interface {}, error)) 0x786ae0
}),
matchers: ([]http.matcher) (len=2 cap=2) {
(*http.routeRegexp)(0xc04200a8a0)({
template: (string) (len=9) "/register",
matchHost: (bool) false,
matchQuery: (bool) false,
strictSlash: (bool) false,
useEncodedPath: (bool) false,
regexp: (*regexp.Regexp)(0xc04204b4a0)({
// -- another giant struct ...
It would be great to be able to tell spew to ignore anything (or output something like <ignored>
instead) that I specify, like *http.Router
and *regexp.Regexp
.
If that isn't possible, maybe passing in a path, like .parent
, or .matchers[n].regexp
would be another option.
Thanks for an awesome script!