1,私服库密码问题
配置git保存密码
git config --global credential.helper store
2,使用goproxy代理服务器
package main
import (
"net/http"
"os"
"github.com/goproxy/goproxy"
)
func main() {
g := goproxy.New()
g.GoBinEnv = append(
os.Environ(),
"GOPROXY=https://goproxy.cn,direct", // 使用 goproxy.cn 作为上游代理
"GOPRIVATE=git.xxxx.com", // 解决私有模块的拉取问题(比如可以配置成公司内部的代码源)
)
http.ListenAndServe("localhost:8080", g)
}
网友评论