[英]Getting error while running go mod tidy like unable to connect to dev.azure.com?
I am running my project in ubuntu 20.04 with wsl2.if we run go mod tidy from project repo then getting the error -go mod tidy我正在使用 wsl2 在 ubuntu 20.04 中运行我的项目。如果我们从项目 repo 运行 go mod tidy 然后得到错误 -go mod tidy
go: dev.azure.com/abc/abc/_git/common.git@v0.0.0-20210319112308-ceb4f9ce35f8: invalid version: git fetch -f git://dev.azure.com/abc/abc/_git/common refs/heads/ :refs/heads/ refs/tags/ :refs/tags/ in /home/name/go/pkg/mod/cache/vcs/6df6b6370763c12eca2ad232218f34099e8f5b956a0323787b3ae4f610e3fe8a: exit status 128: fatal: unable to connect to dev.azure.com: dev.azure.com[0: 13.107.42.20]: errno=Connection timed out go: dev.azure.com/abc/abc/_git/common.git@v0.0.0-20210319112308-ceb4f9ce35f8: invalid version: git fetch -f git://dev.azure.com/abc/abc/_git/common refs/heads/ :refs/heads/ refs/tags/ :refs/tags/ in /home/name/go/pkg/mod/cache/vcs/6df6b6370763c12eca2ad232218f34099e8f5b956a0323787b3ae4f610e3fe8a: exit status 128: fatal: unable to connect to dev.azure. com: dev.azure.com[0: 13.107.42.20]: errno=连接超时
i will share the go env and git config result我将分享 go 环境和 git 配置结果
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/name/.cache/go-build"
GOENV="/home/name/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="dev.azure.com/abc/*"
GONOSUMDB="dev.azure.com/abc/*"
GOOS="linux"
GOPATH="/home/name/go"
GOPRIVATE="dev.azure.com/abc/*"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.13"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/name/go/src/abc/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build067756412=/tmp/go-build -gno-record-gcc-switches"
cat ~/.gitconfig
[user]
name = name
email = name@abc.com
username = name
[url "https://abc:token@dev.azure.com"]
insteadOf = https://dev.azure.com/
If anyone have idea then please help me on this?
It seems that the cache is unreachable or corrupted.似乎缓存无法访问或损坏。 To clear the module cache go clean -modcache
can help.清除模块缓存go clean -modcache
可以提供帮助。 See documentation查看文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.