4 ms·
Sometimes other techniques are more useful. - you can collect errors in a function and return them once or provide an extra method, like http://golang.org/pkg/
by mtrn 11y ago
Sometimes other techniques are more useful.
- you can collect errors in a function and return them once or provide an extra method, like http://golang.org/pkg/bufio/#Scanner.Err http://golang.org/pkg/bufio/#Scanner.Err
- you can type switch on the error; maybe there are errors that you can recover/retry locally, such as connection errors, or general io failures - so you do not need to pass back all errors to the caller
More on errors: https://blog.golang.org/errors-are-values https://blog.golang.org/errors-are-values