Skip to content

Commit

Permalink
Update README with the latest instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
fatih committed Mar 8, 2021
1 parent 014f019 commit cf259bd
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,30 @@ you can configure to fail on such single function of `fmt` as well.
## Install

```bash
go get github.com/fatih/faillint
go install github.com/fatih/faillint@latest
```

## Example

Assume we have the following file:

```go
package a

import (
"errors"
)

func foo() error {
return errors.New("bar!")
}
```

Let's run `faillint` to check if `errors` import is used and report it:

```
$ faillint -paths "errors=github.com/pkg/errors" a.go
a.go:4:2: package "errors" shouldn't be imported, suggested: "github.com/pkg/errors"
```

## Usage
Expand Down Expand Up @@ -121,29 +144,6 @@ func foo() error {
}
```

## Example

Assume we have the following file:

```go
package a

import (
"errors"
)

func foo() error {
return errors.New("bar!")
}
```

Let's run `faillint` to check if `errors` import is used and report it:

```
$ faillint -paths "errors=github.com/pkg/errors" a.go
a.go:4:2: package "errors" shouldn't be imported, suggested: "github.com/pkg/errors"
```

## The need for this tool?

Most of these checks should be probably detected during the review cycle. But
Expand Down

0 comments on commit cf259bd

Please sign in to comment.