Closed frederikhors closed 3 years ago
tomarrell is correct, using %w
causes any error wrapped to implicitly become part of the API which is not necessarily desirable.
go-errorlint can check for %w
but it is disabled by default for this very reason. See also the caveat in the readme:
When using the -errorf lint, keep in mind that any errors wrapped by fmt.Errorf implicitly become part of your API as according to Hyrum's Law.
Dear @polyfloyd,
the great @tomarrell here is suggesting to avoid
%w
.Can I ask for your input on the issue so as to better understand what is right to do?
I'm learning Golang day by day.
Thanks!