Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
GoLand导入go模块公共回购失败,版本无效_Go_Goland_Go Modules - Fatal编程技术网

GoLand导入go模块公共回购失败,版本无效

GoLand导入go模块公共回购失败,版本无效,go,goland,go-modules,Go,Goland,Go Modules,我想将我创建的模块导入到另一个项目中。源代码位于GitHub中的公共repo中,但我在尝试在GoLand中导入时遇到以下错误: go: finding module for package github.com/ambye85/gophercises/link go: downloading github.com/ambye85/gophercises/link v0.0.0-20200323082040-d484a876f7e8 go: downloading github.com/ambye

我想将我创建的模块导入到另一个项目中。源代码位于GitHub中的公共repo中,但我在尝试在GoLand中导入时遇到以下错误:

go: finding module for package github.com/ambye85/gophercises/link
go: downloading github.com/ambye85/gophercises/link v0.0.0-20200323082040-d484a876f7e8
go: downloading github.com/ambye85/gophercises v0.0.0-20200323082040-d484a876f7e8
github.com/ambye85/gophercises/sitemap imports
    github.com/ambye85/gophercises/link: github.com/ambye85/gophercises/link@v0.0.0-20200323082040-d484a876f7e8: verifying module: github.com/ambye85/gophercises/link@v0.0.0-20200323082040-d484a876f7e8: reading https://sum.golang.org/lookup/github.com/ambye85/gophercises/link@v0.0.0-20200323082040-d484a876f7e8: 410 Gone
    server response:
    not found: github.com/ambye85/gophercises/link@v0.0.0-20200323082040-d484a876f7e8: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/a488fe783593bd6e7b765f40dfed37c7e534d0a80ca8e1bff63e11e21f02e8fd: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
我所做的所有搜索似乎都表明,这是试图访问私人回购协议造成的。这里的情况并非如此

有人知道原因和解决方法吗

go-env的输出

go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ashleyb/Library/Caches/go-build"
GOENV="/Users/ashleyb/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/ashleyb/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/pn/8n7495nd5yn6mxxthgv5ghqhtn2mwj/T/go-build279336926=/tmp/go-build -gno-record-gcc-switches -fno-common"
可通过以下方式进行修复:

$git config--全局--添加url。“git@github.com:“.代替”https://github.com/"
当您尝试使用
https
进行身份验证,但已启用2FA时,可能会出现此问题。这可以通过强制git对所有交互使用
ssh
来解决

资源:


即使是公开回购,也面临同样的问题。你的错误解决了吗?如果是,您为此做了什么?这是对私有存储库的访问问题。