【发布时间】:2021-10-18 05:22:16
【问题描述】:
我有一个 Golang 项目,我使用的版本是 1.13。我的模块托管在我的私人仓库中。我的回购开始于:
module <Private-Repo>-service
go 1.13
还有一些来自 Github 的 Repos 和 go 包。我正在使用 Golang 的 vs 代码包
Google 的 Go 团队
我的环境是这样的:
GOROOT="/usr/local/go"
GOPATH="/home/{User}/go"
GOPRIVATE=<Private-Repo-URL>
我要复制我的仓库的文件夹位于 /home/{User}/go/src/
但我无法解决这个问题,它说:
could not import github.com/golang/mock/gomock (cannot find package "github.com/golang/mock/gomock" in any of
/usr/local/go/src/github.com/golang/mock/gomock (from $GOROOT)
/home/{User}/go/src/github.com/golang/mock/gomock (from $GOPATH))compilerBrokenImport
所以我需要在 Visual Studio 代码中解决这个问题。
【问题讨论】:
标签: go visual-studio-code