Skip to content

Commit baa2415

Browse files
LK4D4jirfag
authored andcommitted
Use go env GOPATH for installation
People these days tend to use default GOPATH, so environment variable will be empty. go env GOPATH will work for all cases Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
1 parent 85cf013 commit baa2415

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ The recommended way to install golangci-lint (replace `vX.Y.Z` with the latest
5454
version from the [releases page](https://github.com/golangci/golangci-lint/releases)):
5555

5656
```bash
57-
# binary will be $GOPATH/bin/golangci-lint
58-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin vX.Y.Z
57+
# binary will be $(go env GOPATH)/bin/golangci-lint
58+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin vX.Y.Z
5959

6060
# or install it into ./bin/
6161
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s vX.Y.Z
@@ -69,8 +69,8 @@ golangci-lint --version
6969
As a fallback you can also use `raw.githubusercontent.com`
7070

7171
```bash
72-
# binary will be $GOPATH/bin/golangci-lint
73-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GOPATH/bin vX.Y.Z
72+
# binary will be $(go env GOPATH)/bin/golangci-lint
73+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin vX.Y.Z
7474

7575
# or install it into ./bin/
7676
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s vX.Y.Z
@@ -91,7 +91,7 @@ It's a not recommended for your CI pipeline. Only install like this for your loc
9191

9292
```bash
9393
go get -u github.com/golangci/golangci-lint
94-
cd $GOPATH/src/github.com/golangci/golangci-lint/cmd/golangci-lint
94+
cd $(go env GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint
9595
go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'"
9696
```
9797

README.tmpl.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ The recommended way to install golangci-lint (replace `vX.Y.Z` with the latest
5454
version from the [releases page](https://github.com/golangci/golangci-lint/releases)):
5555

5656
```bash
57-
# binary will be $GOPATH/bin/golangci-lint
58-
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin vX.Y.Z
57+
# binary will be $(go env GOPATH)/bin/golangci-lint
58+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin vX.Y.Z
5959

6060
# or install it into ./bin/
6161
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s vX.Y.Z
@@ -69,8 +69,8 @@ golangci-lint --version
6969
As a fallback you can also use `raw.githubusercontent.com`
7070

7171
```bash
72-
# binary will be $GOPATH/bin/golangci-lint
73-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GOPATH/bin vX.Y.Z
72+
# binary will be $(go env GOPATH)/bin/golangci-lint
73+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin vX.Y.Z
7474

7575
# or install it into ./bin/
7676
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s vX.Y.Z
@@ -91,7 +91,7 @@ It's a not recommended for your CI pipeline. Only install like this for your loc
9191

9292
```bash
9393
go get -u github.com/golangci/golangci-lint
94-
cd $GOPATH/src/github.com/golangci/golangci-lint/cmd/golangci-lint
94+
cd $(go env GOPATH)/src/github.com/golangci/golangci-lint/cmd/golangci-lint
9595
go install -ldflags "-X 'main.version=$(git describe --tags)' -X 'main.commit=$(git rev-parse --short HEAD)' -X 'main.date=$(date)'"
9696
```
9797

0 commit comments

Comments
 (0)