|
|
|
|
|
by kiitos
751 days ago
|
|
> Treating errors as opaque and passing them up the stack in the general case... ...is directly contradictory to one of the most fundamental assertions of the language, which is that errors are values -- https://go.dev/blog/errors-are-values -- and therefore "can [and should] be programmed". |
|
The reality is that the vast majority of error handling in go is to do one of two things
1) pass it up the stack 2) wrap it and pass it up the stack
The fact that you must do this explicitly in all cases is a failure of the language. Many people have pointed this out, but the go team and elite members in the community are very dedicated to the myth that every error is precious and special and must be handled in a one-off manner.