mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
all: use go install
instead of go get
for installing auxiliary tools
This is a preparation for Go 1.16, which deprecates `go get` for installing binaries. See https://tip.golang.org/doc/go1.16#go-command : go install, with or without a version suffix (as described above), is now the recommended way to build and install packages in module mode. go get should be used with the -d flag to adjust the current module's dependencies without building packages, and use of go get to build and install packages is deprecated. In a future release, the -d flag will always be enabled.
This commit is contained in:
parent
5d426dfe0a
commit
0b2726c3be
2 changed files with 7 additions and 7 deletions
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
|
@ -22,9 +22,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GO111MODULE: on
|
GO111MODULE: on
|
||||||
run: |
|
run: |
|
||||||
go get -u golang.org/x/lint/golint
|
go install golang.org/x/lint/golint
|
||||||
go get -u github.com/kisielk/errcheck
|
go install github.com/kisielk/errcheck
|
||||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.27.0
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.29.0
|
||||||
- name: Code checkout
|
- name: Code checkout
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -80,7 +80,7 @@ lint: install-golint
|
||||||
golint app/...
|
golint app/...
|
||||||
|
|
||||||
install-golint:
|
install-golint:
|
||||||
which golint || GO111MODULE=off go get -u golang.org/x/lint/golint
|
which golint || GO111MODULE=off go install golang.org/x/lint/golint
|
||||||
|
|
||||||
errcheck: install-errcheck
|
errcheck: install-errcheck
|
||||||
errcheck -exclude=errcheck_excludes.txt ./lib/...
|
errcheck -exclude=errcheck_excludes.txt ./lib/...
|
||||||
|
@ -94,7 +94,7 @@ errcheck: install-errcheck
|
||||||
errcheck -exclude=errcheck_excludes.txt ./app/vmrestore/...
|
errcheck -exclude=errcheck_excludes.txt ./app/vmrestore/...
|
||||||
|
|
||||||
install-errcheck:
|
install-errcheck:
|
||||||
which errcheck || GO111MODULE=off go get -u github.com/kisielk/errcheck
|
which errcheck || GO111MODULE=off go install github.com/kisielk/errcheck
|
||||||
|
|
||||||
check-all: fmt vet lint errcheck golangci-lint
|
check-all: fmt vet lint errcheck golangci-lint
|
||||||
|
|
||||||
|
@ -140,14 +140,14 @@ quicktemplate-gen: install-qtc
|
||||||
qtc
|
qtc
|
||||||
|
|
||||||
install-qtc:
|
install-qtc:
|
||||||
which qtc || GO111MODULE=off go get -u github.com/valyala/quicktemplate/qtc
|
which qtc || GO111MODULE=off go install github.com/valyala/quicktemplate/qtc
|
||||||
|
|
||||||
|
|
||||||
golangci-lint: install-golangci-lint
|
golangci-lint: install-golangci-lint
|
||||||
golangci-lint run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m
|
golangci-lint run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m
|
||||||
|
|
||||||
install-golangci-lint:
|
install-golangci-lint:
|
||||||
which golangci-lint || GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.29.0
|
||||||
|
|
||||||
docs-sync:
|
docs-sync:
|
||||||
cp app/vmagent/README.md docs/vmagent.md
|
cp app/vmagent/README.md docs/vmagent.md
|
||||||
|
|
Loading…
Reference in a new issue