From a00eb06947739b486af38d30aa50f9184b989f50 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Sat, 10 May 2025 01:00:09 -0700 Subject: [PATCH 1/3] fix: allow testing when CGO_ENABLED=0 --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 686bf37..1b13dbf 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,15 @@ lint: ## golangci-lint vuln: ## govulncheck go tool govulncheck ./... +ifeq ($(strip $(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 From b4c675b62669d5ba7836e93db694c35ed988cd99 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Mon, 12 May 2025 06:37:03 -0700 Subject: [PATCH 2/3] fix: remove unneeded $strip in Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Robert PajÄ…k --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1b13dbf..c4a3630 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ lint: ## golangci-lint vuln: ## govulncheck go tool govulncheck ./... -ifeq ($(strip $(CGO_ENABLED)),0) +ifeq ($(CGO_ENABLED),0) RACE_OPT = else RACE_OPT = -race From 73f3c0ec5d78ceff098eec3b7f5162f85fd5828e Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Mon, 12 May 2025 06:41:41 -0700 Subject: [PATCH 3/3] fix(docs): add entry in CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a66dc1..b40058d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/golang-templates/seed/compare/v0.21.0...HEAD) +### 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