获取码云上文件,go get 或go mod tidy报 terminal prompts disabled错误
go: gitee.com/xxx/xxx@v0.0.0-20191204091802-xxx: invalid version: git fetch -f https://gitee.com/xxx/xxx/heads/*:refs/heads/* refs/tags/*:refs/tags/* in C:\Users\xxx\go\pkg\mod\cache\vcs\xxx: exit status 128:
fatal: could not read Username for 'https://gitee.com': terminal prompts disabled
执行下述操作
1.vscode设置环境变量GOPROXY=https://goproxy.cn,direct
go env -w GOPROXY=https://goproxy.io,direct
# Set environment variable allow bypassing the proxy for selected modules
go env -w GOPRIVATE=*.corp.example.com
go env -w GO111MODULE=on
2.git config --global --add url."git@gitee.com:".insteadOf "https://gitee.com/"
2.go mod tidy 成功