0

我是 Go 语言的新手。我想用这个命令来测试一些 Go 语言的代码一些 Go 语言的代码go run main.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

我错过了什么?

4

1 回答 1

1

perlin-network/noise自 2020 年 8 月以来,目前在issue 287中提到了这一点,目前(2021 年第二季度)没有任何答案。

另一种方法是:

  • 分叉存储库 perlin-network/noise
  • 更新fork中的依赖me/noise
  • 在您的项目中使用go mod replace,以切换存储库。

但是所有这些都表明您自己的项目使用 go mod,因此请确保go init myproject首先使用这些依赖项管理功能。
这样,就不需要了$GOPATH/src

于 2021-06-01T07:38:03.550 回答