build: apply "-mod vendor" also to test target

This commit is contained in:
Yousong Zhou
2019-06-24 13:26:40 +00:00
parent 09d1af78ca
commit ff2ccbed6c

View File

@@ -26,7 +26,8 @@ LDFLAGS := "-w \
#####################################################
GO_BUILD := go build -mod vendor -ldflags $(LDFLAGS)
GO_BUILD_FLAGS:=-mod vendor -ldflags $(LDFLAGS)
GO_BUILD := go build $(GO_BUILD_FLAGS)
GO_INSTALL := go install -ldflags $(LDFLAGS)
GO_TEST := go test
@@ -64,7 +65,7 @@ gencopyright:
@sh scripts/gencopyright.sh pkg cmd
test:
@go test $(shell GO111MODULE=on go list ./... | egrep -v 'host-image|hostimage')
@go test $(GO_BUILD_FLAGS) $(shell go list ./... | egrep -v 'host-image|hostimage')
vet:
go vet ./...