til/Development/Go/errors.md

14 lines
173 B
Markdown
Raw Normal View History

2020-07-13 09:40:47 +00:00
# [errors](https://golang.org/pkg/errors/)
Wrap error:
```go
err := fmt.Errorf("Something wrong: %w", rootErr)
```
Unwrap error:
```go
rootErr := errors.Unwrap(err)
```