我已经在本地计算机上安装了最新版本的 Go,从以下位置下载了源代码https://github.com/rrrkren/topshot-sales https://github.com/rrrkren/topshot-sales,并将项目代码放入我的GOPATH.
当我运行它时go run go/main.go
在我的命令提示符中,我收到这些错误
go\main.go:8:2: no required module provides package github.com/onflow/flow-go-sdk/client: go.mod file not found in current directory or any parent directory; see 'go help modules'
go\main.go:6:2: no required module provides package github.com/rrrkren/topshot-sales/topshot: go.mod file not found in current directory or any parent directory; see 'go help modules'
go\main.go:9:2: no required module provides package google.golang.org/grpc: go.mod file not found in current directory or any parent directory; see 'go help modules'
尽管go.mod文件位于当前目录中。我希望能够下载这个项目并将其保存在我的本地计算机上,这样我就可以随时编辑源代码。我怎样才能做到这一点?
这对我有用。
步骤 1. 如果您对是否正确配置有疑问,请删除任何以前的 Go 版本。
步骤2.安装新的Go版本。从此处下载二进制版本 (Go)去二进制下载 https://golang.org/dl/
注意:要删除并安装新的 Go 版本,您可以使用以下步骤 -Go删除和安装 https://khongwooilee.medium.com/how-to-update-the-go-version-6065f5c8c3ec,他们为我工作。另外我目前使用的版本是1.16.3。
步骤 3. 完成步骤 1 和步骤 2 后,在终端中运行以下命令:
go env -w GO111MODULE=auto
这应该可以做到。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)