Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Print the stack trace when formatting with %+v #26
Conversation
mmikulicic
and others
added some commits
Jun 12, 2016
mjs
commented
Sep 14, 2016
|
Thanks for this. LGTM but I'll leave the final verdict to @howbazaar |
howbazaar
reviewed
Sep 14, 2016
| +} | ||
| + | ||
| +// helper for Format | ||
| +type unformatter Err |
mmikulicic
Jan 19, 2017
Contributor
@howbazaar because otherwise fmt.Fprintf(s, "%#v", e) would yield an infinite recursion.
Any better idea to achieve the same formatting of %#v without re-entering the Format method?
mmikulicic
referenced this pull request
Jan 19, 2017
Merged
Print the stack trace when formatting with %+v #28
|
moving to #28 due to organization membership change |
mmikulicic
closed this
Jan 19, 2017
added a commit
that referenced
this pull request
May 9, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mmikulicic commentedJun 16, 2016
Discovered in:
http://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package
Code based on:
https://github.com/pkg/errors
With a minor but hackish change to still allow
%#vto print the structure fields, in order to not break the principle of least surprise. Let me know if there is a better way to strip a type of an interface or invoke the default%#vbehaviour on a type that implementsfmt.Formatter.