From e690feb36bc4ea849ada397319bac001e7530726 Mon Sep 17 00:00:00 2001 From: Denis Isaev Date: Sat, 26 Jan 2019 18:55:29 +0300 Subject: [PATCH] docs: #377: simplify local installation manual --- README.md | 17 ++++++++++++++--- README.tmpl.md | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d52ece51..1b71b3ed 100644 --- a/README.md +++ b/README.md @@ -90,13 +90,13 @@ update if needed. Local installation is not recommended for your CI pipeline. Only install the linter this way in a local development environment. +#### Windows, MacOS and Linux + ```bash go get -u github.com/golangci/golangci-lint/cmd/golangci-lint -cd $(go env GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint -go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" ``` -(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win). Or you can run just `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`.) +#### MacOS You can also install it on MacOS using [brew](https://brew.sh/): @@ -105,6 +105,17 @@ brew install golangci/tap/golangci-lint brew upgrade golangci/tap/golangci-lint ``` +#### `--version` + +If you need your local `golangci-lint --version` to show proper version additionally run: + +```bash +cd $(go env GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint +go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" +``` + +(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win). + ## Trusted By The following companies/products use golangci-lint: diff --git a/README.tmpl.md b/README.tmpl.md index b798d9da..44f049aa 100644 --- a/README.tmpl.md +++ b/README.tmpl.md @@ -90,13 +90,13 @@ update if needed. Local installation is not recommended for your CI pipeline. Only install the linter this way in a local development environment. +#### Windows, MacOS and Linux + ```bash go get -u github.com/golangci/golangci-lint/cmd/golangci-lint -cd $(go env GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint -go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" ``` -(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win). Or you can run just `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`.) +#### MacOS You can also install it on MacOS using [brew](https://brew.sh/): @@ -105,6 +105,17 @@ brew install golangci/tap/golangci-lint brew upgrade golangci/tap/golangci-lint ``` +#### `--version` + +If you need your local `golangci-lint --version` to show proper version additionally run: + +```bash +cd $(go env GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint +go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'" +``` + +(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win). + ## Trusted By The following companies/products use golangci-lint: