diff --git a/README.md b/README.md index 0ef63c36..1b7e0a7d 100644 --- a/README.md +++ b/README.md @@ -71,19 +71,19 @@ use deprecated option `--enable-all` and a new linter is added or even without ` It's highly recommended to install a fixed version of golangci-lint. Releases are available on the [releases page](https://github.com/golangci/golangci-lint/releases). -Latest version: [v1.20.0](https://github.com/golangci/golangci-lint/releases/tag/v1.20.0) +Latest version: [v1.21.0](https://github.com/golangci/golangci-lint/releases/tag/v1.21.0) Here is the recommended way to install golangci-lint: ```bash # binary will be $(go env GOPATH)/bin/golangci-lint -curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.20.0 +curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.21.0 # or install it into ./bin/ -curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.20.0 +curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0 # In alpine linux (as it does not come with curl by default) -wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.20.0 +wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0 golangci-lint --version ``` @@ -104,7 +104,7 @@ brew upgrade golangci/tap/golangci-lint ### By Docker ```bash -docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.20.0 golangci-lint run -v +docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.21.0 golangci-lint run -v ``` ### go get diff --git a/scripts/gen_readme/main.go b/scripts/gen_readme/main.go index d19330fc..e3b30a3b 100644 --- a/scripts/gen_readme/main.go +++ b/scripts/gen_readme/main.go @@ -43,6 +43,10 @@ func genReadme(tmplPath, outPath string) error { } func getLatestVersion() (string, error) { + if gitTag := os.Getenv("GIT_TAG"); gitTag != "" { + return gitTag, nil + } + out, err := exec.Command("git", "tag", "-l", "--sort=-v:refname").Output() if err != nil { return "", fmt.Errorf("failed to run git tag: %s", err)