From 37e3cacceda09005406ace948c05b29a8ef39dac Mon Sep 17 00:00:00 2001 From: Jan Schintag Date: Tue, 3 Dec 2024 16:54:16 +0100 Subject: [PATCH] Disable CGO when running unit-tests When running unit-tests, go tries to compile using CGO, despite not needing it. This can lead to errors on systems not having gcc installed, or named wrongly. Signed-off-by: Jan Schintag --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee2e443..ed4c688 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ $(GO): # Run unit tests test: $(GO) - $(GO) test ./pkg/... -coverprofile cover.out + CGO_ENABLED=0 $(GO) test ./pkg/... -coverprofile cover.out # Run e2e tests functest: $(GO)