Skip to content

Commit

Permalink
Revert "improve: honor CGO_ENABLED env variable if it is set"
Browse files Browse the repository at this point in the history
Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed Feb 3, 2025
1 parent 64d5b5c commit 12d7dfc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,11 @@ func runBuild(binariesString string) {

ldflags = getLdflags(projInfo)

if os.Getenv("CGO_ENABLED") == "" {
os.Setenv("CGO_ENABLED", "0")
defer os.Unsetenv("CGO_ENABLED")
}
os.Setenv("CGO_ENABLED", "0")
if cgo {
os.Setenv("CGO_ENABLED", "1")
defer os.Unsetenv("CGO_ENABLED")
}
defer os.Unsetenv("CGO_ENABLED")

if binariesString == "all" {
buildAll(ext, prefix, ldflags, getTags(config.Build.Tags), binaries)
Expand Down

0 comments on commit 12d7dfc

Please sign in to comment.