diff --git a/CHANGELOG.md b/CHANGELOG.md index fd052e2..cc77288 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add `run` target which runs `go run`. ([#376](https://github.com/golang-templates/seed/pull/376)) +### Fixed + +- Allow testing when CGO_ENABLED=0. ([#383](https://github.com/golang-templates/seed/pull/383)) + ## [0.21.0](https://github.com/golang-templates/seed/releases/tag/v0.21.0) ### Added diff --git a/Makefile b/Makefile index a8292cc..85cb975 100644 --- a/Makefile +++ b/Makefile @@ -53,9 +53,15 @@ lint: ## golangci-lint vuln: ## govulncheck go tool govulncheck ./... +ifeq ($(CGO_ENABLED),0) +RACE_OPT = +else +RACE_OPT = -race +endif + .PHONY: test test: ## go test - go test -race -covermode=atomic -coverprofile=coverage.out -coverpkg=./... ./... + go test $(RACE_OPT) -covermode=atomic -coverprofile=coverage.out -coverpkg=./... ./... go tool cover -html=coverage.out -o coverage.html .PHONY: diff