You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the request. It's certainly probable that it should have been, but I am very reluctant to add something like this that will change the behavior for existing code, as (for better or worse) some users of this library have hard-coded the expected output of Print instead of comparing against a golden value with Diff. Adding a config flag is certainly an option, but I am also reluctant to add configuration for things that can be accommodated with existing configs.
For anyone who comes across this, my recommended current approach is to use config.Formatter to opt-in to GoString for the types you require.
I will tag this as a potential feature for v2, in case we do wind up with enough breaking changes to require one.
Also, check out package cmp. I generally think it does the job better and is already more featureful than pretty.
Apart from
fmt.Stringer
, it would be good iffmt.GoStringer
was supportedI think
GoStringer
should (at least by default) have higher priority thanfmt.Stringer
The text was updated successfully, but these errors were encountered: