Skip to content

Commit a00eb06

Browse files
authored
fix: allow testing when CGO_ENABLED=0
1 parent 19d87f9 commit a00eb06

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ lint: ## golangci-lint
4949
vuln: ## govulncheck
5050
go tool govulncheck ./...
5151

52+
ifeq ($(strip $(CGO_ENABLED)),0)
53+
RACE_OPT =
54+
else
55+
RACE_OPT = -race
56+
endif
57+
5258
.PHONY: test
5359
test: ## go test
54-
go test -race -covermode=atomic -coverprofile=coverage.out -coverpkg=./... ./...
60+
go test $(RACE_OPT) -covermode=atomic -coverprofile=coverage.out -coverpkg=./... ./...
5561
go tool cover -html=coverage.out -o coverage.html
5662

5763
.PHONY: diff

0 commit comments

Comments
 (0)