Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/romanyx/erris
Linter for errors.Is and errors.As
https://github.com/romanyx/erris
Last synced: 3 months ago
JSON representation
Linter for errors.Is and errors.As
- Host: GitHub
- URL: https://github.com/romanyx/erris
- Owner: romanyx
- License: mit
- Created: 2019-11-26T14:36:04.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-03T13:42:49.000Z (almost 5 years ago)
- Last Synced: 2024-06-06T05:32:28.057Z (5 months ago)
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 46
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- go-awesome - erris - linters for "errors.Is" and "errors.As". (Open source library / Error Handling)
README
# erris
erris is a program for checking that errors are compared or type asserted using go1.13 `errors.Is` and `errors.As` functions.
[![Build Status](https://travis-ci.org/romanyx/erris.png?branch=master)](https://travis-ci.org/romanyx/erris)
[![Report](https://goreportcard.com/badge/github.com/romanyx/erris)](https://goreportcard.com/report/github.com/romanyx/erris)## Install
```sh
go get -u github.com/romanyx/erris/cmd/erris
```## Use
For basic usage, just give the package path of interest as the first argument:
```sh
erris github.com/romanyx/erris/testdata
```Outputs:
```sh
github.com/romanyx/erris/testdata/main.go:14:5: use errors.Is to compare an error
github.com/romanyx/erris/testdata/main_test.go:11:14: use errors.As to type assert an error
```To check all packages beneath the current directory:
```
erris ./...
```