docs: update the latest release to v1.21.0

This commit is contained in:
Denis Isaev 2019-10-15 20:55:02 +03:00
parent df279922f6
commit 645e79404d
No known key found for this signature in database
GPG Key ID: A36A0EC8E27A1A01
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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)