From 3b52adaf3fbeb37b63c0d6b6e4176b2ffe3d01d3 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 26 May 2019 23:19:34 +0300 Subject: [PATCH] Makefile: pass `GO111MODULE=on` to all the `go` invocations --- Makefile | 21 ++++++++++++--------- deployment/docker/Makefile | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 7e00d04b2b..9de6837dfa 100644 --- a/Makefile +++ b/Makefile @@ -33,12 +33,12 @@ package: \ package-vminsert fmt: - gofmt -l -w -s ./lib - gofmt -l -w -s ./app + GO111MODULE=on gofmt -l -w -s ./lib + GO111MODULE=on gofmt -l -w -s ./app vet: - go vet $(PKG_PREFIX)/lib/... - go vet $(PKG_PREFIX)/app/... + GO111MODULE=on go vet ./lib/... + GO111MODULE=on go vet ./app/... lint: install-golint golint lib/... @@ -57,15 +57,18 @@ install-errcheck: which errcheck || GO111MODULE=off go get -u github.com/kisielk/errcheck test: - go test $(PKG_PREFIX)/lib/... + GO111MODULE=on go test ./lib/... + GO111MODULE=on go test ./app/... benchmark: - go test -bench=. $(PKG_PREFIX)/lib/... + GO111MODULE=on go test -bench=. ./lib/... + GO111MODULE=on go test -bench=. ./app/... vendor-update: - go get -u - go mod tidy - go mod vendor + GO111MODULE=on go get -u ./lib/... + GO111MODULE=on go get -u ./app/... + GO111MODULE=on go mod tidy + GO111MODULE=on go mod vendor app-local: GO111MODULE=on go build $(RACE) -mod=vendor -ldflags "$(GO_BUILDINFO)" -o bin/$(APP_NAME)$(RACE) $(PKG_PREFIX)/app/$(APP_NAME) diff --git a/deployment/docker/Makefile b/deployment/docker/Makefile index a57f1f6169..6d32ba04fa 100644 --- a/deployment/docker/Makefile +++ b/deployment/docker/Makefile @@ -20,6 +20,7 @@ app-via-docker: package-certs package-builder -w /VictoriaMetrics \ --mount type=bind,src="$(shell pwd)/gocache-for-docker",dst=/gocache \ --env GOCACHE=/gocache \ + --env GO111MODULE=on \ $(BUILDER_IMAGE) \ go build $(RACE) -mod=vendor -ldflags "-s -w -extldflags '-static' $(GO_BUILDINFO)" -tags 'netgo osusergo' -o bin/$(APP_NAME)-prod $(PKG_PREFIX)/app/$(APP_NAME)