Closed cristaloleg closed 4 months ago
Is there a fundamental difference between those? I always assumed the resulting errors are sort of identical
Nah, underneath, it will be the same error—the only thing why errors.New is better in this context is that nobody in the future will ask: are we missing params here?
(Hmm, I recall one more pro: when we migrated to another error library, we had a smaller diff due to the absence of such patterns).
Overview
Small cleanup PR. Use
errors.New
when parameter is const (instead offmt.Errorf
).