go-erorr/README.md

27 lines
686 B
Markdown
Raw Normal View History

# go-erorr
2021-11-19 23:41:30 +00:00
Package **erorr** implements tools to create and manipulate errors.
(This package used to be called "fck".)
2021-11-19 23:41:30 +00:00
## Documention
Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-erorr
2021-11-19 23:41:30 +00:00
[![GoDoc](https://godoc.org/sourcecode.social/reiver/go-erorr?status.svg)](https://godoc.org/sourcecode.social/reiver/go-erorr)
2021-11-19 23:41:30 +00:00
## Creating Errors
There are two ways to create errors —
With `erorr.Error`:
2021-11-19 23:41:30 +00:00
```
const err error = erorr.Error("internal-error")
2021-11-19 23:41:30 +00:00
```
And with `erorr.Errorf`:
2021-11-19 23:41:30 +00:00
```
var err error = erorr.Errorf("bad value for id %q", id)
2021-11-19 23:41:30 +00:00
```
**One thing to notice is that `erorr.Error` errors can be a Go `const`.**