build.go: Make binaries completely static (disables cgo)

This commit is contained in:
Alexander Neumann 2017-01-12 19:51:19 +01:00
parent 62b1056860
commit 7e0a4c66e7

View file

@ -205,7 +205,7 @@ func cleanEnv() (env []string) {
func build(cwd, goos, goarch, gopath string, args ...string) error {
args = append([]string{"build"}, args...)
cmd := exec.Command("go", args...)
cmd.Env = append(cleanEnv(), "GOPATH="+gopath, "GOARCH="+goarch, "GOOS="+goos)
cmd.Env = append(cleanEnv(), "GOPATH="+gopath, "GOARCH="+goarch, "GOOS="+goos, "CGO_ENABLED=0")
cmd.Dir = cwd
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr