英文:
Cannot find module providing package ed25519 in Go language
问题
我是你的中文翻译助手,以下是翻译的内容:
我是Go语言的新手。我想使用命令go run main.go
来测试一些Go语言的代码。
我遇到了这个错误:
cannot find module providing package github.com/perlin-network/noise/crypto/ed25519
我尝试使用以下命令进行安装:
go get github.com/perlin-network/noise/crypto/ed25519
我得到了这个错误:
go: finding github.com/perlin-network/noise/crypto/ed25519 latest
go: finding github.com/perlin-network/noise/crypto latest
go get github.com/perlin-network/noise/crypto/ed25519: no matching versions for query "latest"
我还尝试了这个:
go get -u github.com/perlin-network/noise
错误信息如下:
go: finding github.com/oasislabs/ed25519 latest
go: finding golang.org/x/lint latest
go: finding golang.org/x/xerrors latest
go: finding golang.org/x/crypto latest
go: github.com/oasislabs/ed25519@v0.0.0-20210505154701-76d8c688d86e: parsing go.mod: unexpected module path "github.com/oasisprotocol/ed25519"
go: finding golang.org/x/net latest
go get: error loading module requirements
我有什么遗漏吗?
英文:
I'm new in Go language. I want to test some code in Go language some code in Go language by using this command go run main.go
.
I have this error:
cannot find module providing package github.com/perlin-network/noise/crypto/ed25519
I tried to install it using:
go get github.com/perlin-network/noise/crypto/ed25519
I get this error:
go: finding github.com/perlin-network/noise/crypto/ed25519 latest
go: finding github.com/perlin-network/noise/crypto latest
go get github.com/perlin-network/noise/crypto/ed25519: no matching versions for query "latest"
I also have tried this:
go get -u github.com/perlin-network/noise
The error:
go: finding github.com/oasislabs/ed25519 latest
go: finding golang.org/x/lint latest
go: finding golang.org/x/xerrors latest
go: finding golang.org/x/crypto latest
go: github.com/oasislabs/ed25519@v0.0.0-20210505154701-76d8c688d86e: parsing go.mod: unexpected module path "github.com/oasisprotocol/ed25519"
go: finding golang.org/x/net latest
go get: error loading module requirements
Did I miss something?
答案1
得分: 1
这是目前在perlin-network/noise
问题287中提到的,自2020年8月以来,至今没有任何答案(2021年第二季度)。
另一种方法是:
- 分叉存储库
perlin-network/noise
- 在分叉
me/noise
中更新依赖项 - 在项目中使用
go mod replace
,切换存储库。
但是,所有这些都暗示您自己的项目使用go mod,所以请确保首先运行go init myproject
,以便从这些依赖项管理功能中受益。这样就不需要$GOPATH/src
了。
英文:
This is currently mentioned in perlin-network/noise
issue 287, since Aug. 2020, without any answer for now (Q2 2021).
An alternative would be to:
- fork the repository
perlin-network/noise
- update the dependency in the fork
me/noise
- use
go mod replace
in your project, to switch repositories.
But all that suggests your own project uses go mod, so make sure to go init myproject
first, in order to benefit from those dependencies management feature.
That way, no need to $GOPATH/src
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论