From 0b2726c3be723aad541fd9b28105614913ce1d16 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 14 Dec 2020 20:04:27 +0200 Subject: [PATCH] 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. --- .github/workflows/main.yml | 6 +++--- Makefile | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 669de3f20..16d3cdcef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,9 +22,9 @@ jobs: env: GO111MODULE: on run: | - go get -u golang.org/x/lint/golint - go get -u 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 + go install golang.org/x/lint/golint + 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.29.0 - name: Code checkout uses: actions/checkout@master - name: Build diff --git a/Makefile b/Makefile index 3257e7777..b20c241fa 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ lint: install-golint golint app/... 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 -exclude=errcheck_excludes.txt ./lib/... @@ -94,7 +94,7 @@ errcheck: install-errcheck errcheck -exclude=errcheck_excludes.txt ./app/vmrestore/... 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 @@ -140,14 +140,14 @@ quicktemplate-gen: install-qtc 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 run --exclude '(SA4003|SA1019|SA5011):' -D errcheck -D structcheck --timeout 2m 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: cp app/vmagent/README.md docs/vmagent.md