1芜抒,私服庫(kù)密碼問題
配置git保存密碼
git config --global credential.helper store
2,使用goproxy代理服務(wù)器
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", // 解決私有模塊的拉取問題(比如可以配置成公司內(nèi)部的代碼源)
)
http.ListenAndServe("localhost:8080", g)
}