go env -w GOSUMDB=off

如果go get时啥的出问题, 一定记得关闭GOSUMDB, 命令为

go env -w GOSUMDB=off

几乎所有和go mod有关的疑难杂症,都是没执行这个命令!

或者直接改环境变量:
export GOSUMDB=off


私有笔记


invalid pseudo-version: preceding tag not found


如果报invalid pseudo-version: preceding tag not found,执行下go clean --modcache

fatal: could not read Username for ‘https://github.com‘: terminal prompts disabled

git config –global –add url.”git@github.com:”.insteadOf “https://github.com/