docs: update the latest release to v1.21.0
This commit is contained in:
parent
df279922f6
commit
645e79404d
10
README.md
10
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.
|
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).
|
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:
|
Here is the recommended way to install golangci-lint:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# binary will be $(go env GOPATH)/bin/golangci-lint
|
# 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/
|
# 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)
|
# 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
|
golangci-lint --version
|
||||||
```
|
```
|
||||||
@ -104,7 +104,7 @@ brew upgrade golangci/tap/golangci-lint
|
|||||||
### By Docker
|
### By Docker
|
||||||
|
|
||||||
```bash
|
```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
|
### go get
|
||||||
|
@ -43,6 +43,10 @@ func genReadme(tmplPath, outPath string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getLatestVersion() (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()
|
out, err := exec.Command("git", "tag", "-l", "--sort=-v:refname").Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to run git tag: %s", err)
|
return "", fmt.Errorf("failed to run git tag: %s", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user