TL;DR
某个项目 mod 托管在 gitcode,无法拉取。git 登陆也不行,需要配置 git 针对 gitcode 默认走 ssh 协议:
git config --global url."ssh://[email protected]".insteadOf "https://gitcode.com"在网上查到比较多的是针对 gitlab 或 github 的:
# gitlab
git config --global url."ssh://git@gitlab-company".insteadOf "https://gitlab.xxx.cn"
# github的同理
git config --global url."ssh://git@github-company".insteadOf "https://github.com"配置后就可以正常 go mod tidy 了。