Thank you all :)

Le jeu. 25 juin 2020 à 06:37, andrey mirtchovski <mirtchov...@gmail.com> a
écrit :

> >> fmt.Formatter is woefully under documented.
> >
> > My reference is pkg/errros -
> https://github.com/pkg/errors/blob/master/errors.go#L127
>
> we have wasted tens of man-hours hunting for a bug that didn't
> manifest in logs due to that custom formatter. %#v basically went
> directly to stringer without embedding type information (the
> fallthrough, line 135 in the link you linked). it was difficult to
> hunt and lead us to believe that custom formatters should be avoided.
> in the end we switched away from pkg/errors using the new stuff
> available as standard in go 1.14. the other lesson we learned is that
> it's better to be explicit than implicit. wrapping nil errors with
> .Wrap returning nil resulted in a lot of assumptions that confused
> coders not experienced with that package. when we switched to %w
> errors popped up where not expected because the explicitness of the %w
> flag doesn't allow a nil error to be used with it.
>
> nothing against the package, it served us well for a very long time.
> but it was time for a change.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAK4xykVQrA22MjKpMweR9QDmOsVEEg5TVEhHFqZKoVva7y8HAw%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAF1Qswgt-G0MZoxxgroUQ-k1frKX4gFKagG1f1nkZvW2tL9Tnw%40mail.gmail.com.

Reply via email to