简体   繁体   English

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

[英]Cannot find module providing package ed25519 in Go language

I'm new in Go language.我是 Go 语言的新手。 I want to test some code in Go language some code in Go language by using this command go run main.go . 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我有这个错误: 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?我错过了什么?

This is currently mentioned in perlin-network/noise issue 287 , since Aug. 2020, without any answer for now (Q2 2021).自 2020 年 8 月以来,目前在perlin-network/noise issue 287中提到了这一点,目前(2021 年第二季度)没有任何答案。

An alternative would be to:另一种方法是:

  • fork the repository perlin-network/noise fork 存储库perlin-network/noise
  • update the dependency in the fork me/noise更新 fork me/noise中的依赖关系
  • use go mod replace in your project, to switch repositories.在您的项目中使用go mod replace来切换存储库。

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.但是所有这些都表明您自己的项目使用 go mod ,因此请确保首先go init myproject ,以便从这些依赖项管理功能中受益。
That way, no need to $GOPATH/src .这样,不需要$GOPATH/src

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM