Skip to content

Commit 60efa78

Browse files
authored
fix: allow testing when CGO_ENABLED=0 (#383)
1 parent afa4fc5 commit 60efa78

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add `run` target which runs `go run`. ([#376](https://github.com/golang-templates/seed/pull/376))
1313

14+
### Fixed
15+
16+
- Allow testing when CGO_ENABLED=0. ([#383](https://github.com/golang-templates/seed/pull/383))
17+
1418
## [0.21.0](https://github.com/golang-templates/seed/releases/tag/v0.21.0)
1519

1620
### Added

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ lint: ## golangci-lint
5353
vuln: ## govulncheck
5454
go tool govulncheck ./...
5555

56+
ifeq ($(CGO_ENABLED),0)
57+
RACE_OPT =
58+
else
59+
RACE_OPT = -race
60+
endif
61+
5662
.PHONY: test
5763
test: ## go test
58-
go test -race -covermode=atomic -coverprofile=coverage.out -coverpkg=./... ./...
64+
go test $(RACE_OPT) -covermode=atomic -coverprofile=coverage.out -coverpkg=./... ./...
5965
go tool cover -html=coverage.out -o coverage.html
6066

6167
.PHONY: diff

0 commit comments

Comments
 (0)