Closed mdwhatcott closed 6 years ago
Ok, it's not fmt
's fault--it's that we are using go-render. So, maybe there's something we can do to tweak that code?
So, we can tweak go-render to print a friendlier representation of time.Time in the case where it is a public field on a struct. All bets are off when the time instance is a private field...
Fixed: 8b2eda5c2435b8e38e4246c468c4aa5e0b261875
In failure scenarios where complex structs (like
time.Time
instances) don't match, the resulting output is cumbersome at best to visually parse. The serializer currently makes use of the%+v
formatting flag to print stuff. This might sound crazy but we could actually reimplement some of the inner workings of the fmt package to make insert inspections forfmt.GoStringer
orfmt.Stringer
or any other custom interface defined by the assertions package.