Closed mvdan closed 2 years ago
Also worth noting that I can't use new(*errTargetNonPtr)
, as that will never match.
Interesting! *errTargetNonPtr
still implements error
, so when it is formatted it matches the error case and therefore e<msg>
is used, rather than the more generic fmt.Sprintf("%# v", pretty.Formatter(v))
. We should probably more explicitly format "as" in the checker.
Indeed; as
is about the target type, not value, so IMO it should always print the type.
Please feel free to take over the fix, by the way. I'm not familiar with the codebase, so it's not clear to me what bit of code should get fixed. Hopefully you can just reuse the test.
Please feel free to take over the fix, by the way. I'm not familiar with the codebase, so it's not clear to me what bit of code should get fixed. Hopefully you can just reuse the test.
Sure, I proposed a possible fix at https://github.com/frankban/quicktest/pull/128
Thanks! Closing in favor of that then.
(see commit message)