From 2f9f946c8799ce5f3d1440021612c356c4af2dbb Mon Sep 17 00:00:00 2001 From: wenxuan70 Date: Mon, 5 Sep 2022 23:17:39 +0800 Subject: [PATCH] feat: fix GOPROXY bug by exporting environment variable (#1106) --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index f024f63e..35b56a12 100755 --- a/build.sh +++ b/build.sh @@ -6,6 +6,6 @@ then echo "Successfully connected to Google, no need to use Go proxy" else echo "Google is blocked, Go proxy is enabled: GOPROXY=https://goproxy.cn,direct" - GO_PROXY_SETTING=$(GOPROXY=https://goproxy.cn,direct) + export GOPROXY="https://goproxy.cn,direct" fi -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $GO_PROXY_SETTING go build -ldflags="-w -s" -o server . +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o server .