build.sh脚本:
#!/bin/bash
set -ex
export GOPATH=/go
export GOPROXY="https://go-athens.tencent.net/repository/sz/,direct"
export GOSUMDB="off"
export GO111MODULE="on"
export GONOSUMDB="gitlab.tencent.com,gitlab.tencent.sz"
ls
pwd
go env
go build -o $1 ./cmd/main.go
ls
执行脚本,报错:
...
invalid $GOPROXY setting: cannot have comma
...
解决方案:
修改GOPROXY里面的内容为:
...
export GOPROXY="https://go-athens.tencent.net/repository/sz/"
...