https://dave.cheney.net/2016/04/27/dont-just-check-errors-ha...
https://dave.cheney.net/2016/04/27/dont-just-check-errors-ha...
The entire stdlib does this. An error stack is never present from stdlib functions' errors, and third party libraries I see it just as infrequently.
If only novice go devs do that, than the entire go core team are novices, as well as the authors of popular go projects like kubernetes and docker.
It seems better to have coarse-grained types than to standardize the wrong type hierarchy?
All of that being said, modern Go (written in the past few years) could avoid these pitfalls. But very few production codebases were both written in the past few years and only use libraries written in the past few years.
I've worked on Go codebases for the past 5-6 years.
And it's not like they couldn't add better types to errors without breaking backwards compat. Returning a type that implements error instead of fmt.Errorf doesn't break existing semantics.