[Talking-Golang (Go)] Errors
errors
error
is a interface, here is its definition:
1 | type error interface { |
Error without stack
The traditional error handling idiom in Go is roughly akin to
1 | import "errors" |
Func New
, wrap, Unwrap
, Is
, As
provided by errors
package.
1 | // main.go |
References
[1] errors - The Go Programming Language - https://golang.org/pkg/errors/
[2] errors | Effective Go - The Go Programming Language - https://golang.org/doc/effective_go#errors
[3] Working with Errors in Go 1.13 - The Go Blog - https://blog.golang.org/go1.13-errors