From cf259bdd2dbaeea6bf0037df158d34aa6851b753 Mon Sep 17 00:00:00 2001 From: Fatih Arslan Date: Mon, 8 Mar 2021 13:49:23 +0300 Subject: [PATCH] Update README with the latest instructions --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 32d9ca3..4a653a6 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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