Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 main

import "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)
```