From d35600780e8823c3ac923a6cc21a5ded5f1e4039 Mon Sep 17 00:00:00 2001 From: Sumanth Chinthagunta Date: Mon, 8 Jul 2019 20:21:10 -0700 Subject: [PATCH] Update gobuild.go (#56) Changing the order of environment variables so that user supplied value for `CGO_ENABLED` take priority https://github.com/google/ko/issues/52 --- pkg/build/gobuild.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/build/gobuild.go b/pkg/build/gobuild.go index 5555d792c2..454d1e382c 100644 --- a/pkg/build/gobuild.go +++ b/pkg/build/gobuild.go @@ -117,7 +117,7 @@ func build(ip string, disableOptimizations bool) (string, error) { // Last one wins // TODO(mattmoor): GOARCH=amd64 - cmd.Env = append(os.Environ(), "CGO_ENABLED=0", "GOOS=linux") + cmd.Env = append([]string{"CGO_ENABLED=0", "GOOS=linux"}, os.Environ()...) var output bytes.Buffer cmd.Stderr = &output