Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
blizzy78 committed Feb 17, 2024
1 parent f58ebce commit 424d6f2
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,31 @@ FOO: // error
```


Standalone Usage
----------------
Running
-------

The `cmd/consistent/` folder provides a standalone command line utility. You can build it like this:
There are multiple ways to run the analyzer:

- Using Go directly:

```
go run github.com/blizzy78/consistent/cmd/consistent@latest ARGS
```

- Install using Go, then running from $PATH:

```
go install github.com/blizzy78/consistent/cmd/consistent@latest
consistent ARGS
```

- Using Go vet:

```
go install github.com/blizzy78/consistent/cmd/consistent@latest
go vet -vettool=$(which consistent) ARGS
```

```
go build -o consistent ./cmd/consistent/
```

**Usage**

Expand Down Expand Up @@ -317,6 +334,8 @@ Flags:
check function/method return value types (ignore/explicit/compact) (default explicit)
-singleImports value
check single import declarations (ignore/bare/parens) (default bare)
-slogAttrs value
check log/slog argument types (ignore/bare/attr/consistent) (default attr)
-source
no effect (deprecated)
-switchCases value
Expand All @@ -325,6 +344,8 @@ Flags:
check switch default clauses (ignore/last/first) (default last)
-tags string
no effect (deprecated)
-test
indicates whether test files should be analyzed, too (default true)
-trace string
write trace log to this file
-typeParams value
Expand Down

0 comments on commit 424d6f2

Please sign in to comment.