在Go语言中找不到提供ed25519包的模块。

huangapple go评论178阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2021年6月1日 03:41:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/67779441.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定