Skip to content

Commit 8932b55

Browse files
Disable CGO
This changes the build tasks for this project to disable CGO. The goal is to create safer binaries by reducing the attack surface and avoiding dependence on third-party modules that use C.
1 parent 9b238ec commit 8932b55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tasks.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func TaskAuditVulnerabilities(t *T) error {
7171
// Build the ghasum binary for the current platform.
7272
func TaskBuild(t *T) error {
7373
t.Log("Building...")
74-
return t.Exec(`go build -trimpath ./cmd/ghasum`)
74+
return t.Exec(`env CGO_ENABLED=0 go build -trimpath ./cmd/ghasum`)
7575
}
7676

7777
// Build the ghasum binary for all supported platforms.
@@ -133,7 +133,7 @@ func TaskBuildAll(t *T) error {
133133

134134
var (
135135
compile = fmt.Sprintf(
136-
"env GOOS=%s GOARCH=%s go build -trimpath -o %s ./cmd/ghasum",
136+
"env GOOS=%s GOARCH=%s CGO_ENABLED=0 go build -trimpath -o %s ./cmd/ghasum",
137137
target.os,
138138
target.arch,
139139
executable,

0 commit comments

Comments
 (0)