From a6ceedd470f490913b05b2eb5114dc7bcd45e210 Mon Sep 17 00:00:00 2001 From: 24sama Date: Sat, 2 Apr 2022 16:11:09 +0800 Subject: [PATCH] disable cgo when use command "make vet" Signed-off-by: 24sama --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 98a563c3..f5201c90 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ fmt: ## Run go fmt against code. go fmt ./... vet: ## Run go vet against code. - go vet $(BUILDFLAGS) ./... + GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=0 go vet $(BUILDFLAGS) ./... test: manifests generate fmt vet envtest ## Run tests. KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out