From 8185a2677f5118271c32c3c78abfb224c74f8841 Mon Sep 17 00:00:00 2001 From: Equim Date: Tue, 8 Aug 2017 00:00:47 +0800 Subject: [PATCH] unset $GOOS and $GOARCH before setting --- go.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.go b/go.go index b0633e7..741c1c7 100644 --- a/go.go +++ b/go.go @@ -34,6 +34,8 @@ type CompileOpts struct { // GoCrossCompile func GoCrossCompile(opts *CompileOpts) error { + os.Unsetenv("GOOS") + os.Unsetenv("GOARCH") env := append(os.Environ(), "GOOS="+opts.Platform.OS, "GOARCH="+opts.Platform.Arch)