Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cou929/efc
Error format checker for projects which uses pkg/errors
https://github.com/cou929/efc
go static-code-analysis
Last synced: 3 days ago
JSON representation
Error format checker for projects which uses pkg/errors
- Host: GitHub
- URL: https://github.com/cou929/efc
- Owner: cou929
- License: mit
- Created: 2019-07-07T13:06:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-07T23:30:21.000Z (over 5 years ago)
- Last Synced: 2024-12-10T04:09:44.172Z (about 2 months ago)
- Topics: go, static-code-analysis
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# efc
Error printing format checker.
efc reports printing format which does not use `%+v` directive for error type.
Intend to be applied to projects which uses [pkg/errors](https://github.com/pkg/errors). See also https://godoc.org/github.com/pkg/errors#hdr-Formatted_printing_of_errors
## Insall
```
go install github.com/cou929/efc/cmd/efc
```## Example
```go
package mainimport "fmt"
func main() {
var err error
fmt.Printf("err %v", err)
}
```efc reports this source like below:
```
$ efc -c=0 ./...
path/to/file/sample.go:7:2: should use %+v format for error type
7 fmt.Printf("err %v", err)
```