doc: improve installation section (#3610)
This commit is contained in:
parent
fe53ca0cd4
commit
defde13179
@ -44,8 +44,38 @@ and is constantly being improved. For any problems with `golangci-lint`, check o
|
|||||||
|
|
||||||
## Local Installation
|
## Local Installation
|
||||||
|
|
||||||
|
### Binaries
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# binary will be $(go env GOPATH)/bin/golangci-lint
|
||||||
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion}
|
||||||
|
|
||||||
|
golangci-lint --version
|
||||||
|
```
|
||||||
|
|
||||||
|
On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win).
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
||||||
|
```
|
||||||
|
|
||||||
|
Preserving cache between consecutive runs:
|
||||||
|
```sh
|
||||||
|
docker run --rm -v $(pwd):/app -v ~/.cache/golangci-lint/{.LatestVersion}:/root/.cache -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
||||||
|
```
|
||||||
|
|
||||||
|
Colored output:
|
||||||
|
```sh
|
||||||
|
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
||||||
|
```
|
||||||
|
|
||||||
### macOS
|
### macOS
|
||||||
|
|
||||||
|
Note: brew can use a non-expected version of Go to build the binary,
|
||||||
|
so we recommend either using our binaries or be sure of the version of Go used to build.
|
||||||
|
|
||||||
You can install a binary release on macOS using [brew](https://brew.sh/):
|
You can install a binary release on macOS using [brew](https://brew.sh/):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@ -69,33 +99,6 @@ The macports installation mode is community driven, and not officially maintaine
|
|||||||
sudo port install golangci-lint
|
sudo port install golangci-lint
|
||||||
```
|
```
|
||||||
|
|
||||||
### Docker
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
|
||||||
```
|
|
||||||
|
|
||||||
Preserving cache between consecutive runs:
|
|
||||||
```sh
|
|
||||||
docker run --rm -v $(pwd):/app -v ~/.cache/golangci-lint/{.LatestVersion}:/root/.cache -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
|
||||||
```
|
|
||||||
|
|
||||||
Colored output:
|
|
||||||
```sh
|
|
||||||
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
|
|
||||||
```
|
|
||||||
|
|
||||||
### Linux and Windows
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# binary will be $(go env GOPATH)/bin/golangci-lint
|
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin {.LatestVersion}
|
|
||||||
|
|
||||||
golangci-lint --version
|
|
||||||
```
|
|
||||||
|
|
||||||
On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win).
|
|
||||||
|
|
||||||
### Install from Source
|
### Install from Source
|
||||||
|
|
||||||
Note: such `go install`/`go get` installation aren't guaranteed to work. We recommend using binary installation.
|
Note: such `go install`/`go get` installation aren't guaranteed to work. We recommend using binary installation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user