Skip to content

Commit 358ce7c

Browse files
tpoundsjirfag
authored andcommitted
Enable Go module support across all commands. (golangci#717)
1 parent a653032 commit 358ce7c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.DEFAULT_GOAL = test
22
.PHONY: FORCE
33

4+
# Enable Go module support across all commands.
5+
export GO111MODULE = on
6+
47
# Build
58

69
fast_build: FORCE
@@ -14,15 +17,12 @@ clean:
1417
.PHONY: fast_build build build_race clean
1518

1619
# Test
17-
test: export GO111MODULE = on
1820
test: export GOLANGCI_LINT_INSTALLED = true
19-
2021
test: build
2122
GL_TEST_RUN=1 time ./golangci-lint run -v
2223
GL_TEST_RUN=1 time ./golangci-lint run --fast --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
2324
GL_TEST_RUN=1 time ./golangci-lint run --no-config -v --skip-dirs 'test/testdata_etc,internal/(cache|renameio|robustio)'
2425
GL_TEST_RUN=1 time go test -v ./...
25-
2626
.PHONY: test
2727

2828
test_race:
@@ -69,19 +69,19 @@ golangci-lint: FORCE pkg/logutils/mock_logutils/mock_log.go
6969
go build -o $@ ./cmd/golangci-lint
7070

7171
tools/mockgen: go.mod go.sum
72-
GOBIN=$(CURDIR)/tools GO111MODULE=on go install github.com/golang/mock/mockgen
72+
GOBIN=$(CURDIR)/tools go install github.com/golang/mock/mockgen
7373

7474
tools/goimports: go.mod go.sum
75-
GOBIN=$(CURDIR)/tools GO111MODULE=on go install golang.org/x/tools/cmd/goimports
75+
GOBIN=$(CURDIR)/tools go install golang.org/x/tools/cmd/goimports
7676

7777
tools/go.mod:
7878
@mkdir -p tools
7979
@rm -f $@
80-
cd tools && GO111MODULE=on go mod init local-tools
80+
cd tools && go mod init local-tools
8181

8282
tools/godownloader: Makefile tools/go.mod
8383
# https://github.com/goreleaser/godownloader/issues/133
84-
cd tools && GOBIN=$(CURDIR)/tools GO111MODULE=off go get -u github.com/goreleaser/godownloader
84+
cd tools && GOBIN=$(CURDIR)/tools go get -u github.com/goreleaser/godownloader
8585

8686
tools/svg-term:
8787
@mkdir -p tools
@@ -106,11 +106,11 @@ pkg/logutils/mock_logutils/mock_log.go: tools/mockgen tools/goimports pkg/loguti
106106
PATH=$(CURDIR)/tools:$${PATH} go generate ./...
107107

108108
go.mod: FORCE
109-
GO111MODULE=on go mod verify
110-
GO111MODULE=on go mod tidy
109+
go mod tidy
110+
go mod verify
111111
go.sum: go.mod
112112

113113
.PHONY: vendor
114114
vendor: go.mod go.sum
115115
rm -rf vendor
116-
GO111MODULE=on go mod vendor
116+
go mod vendor

0 commit comments

Comments
 (0)