0

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?

ismsm
  • 143
  • 2
  • 11
  • 1
    github.com/perlin-network/noise uses an old import path (oasislabs has been renamed to oasisprotocol). If removing the -u flag doesn't work you have to ask the perlin-network/noise maintainer to update the imports. – Peter Jun 01 '21 at 06:11
  • probably your working directory is wrong ,must be in $GOPATH/src – dılo sürücü Jun 01 '21 at 07:55

1 Answers1

1

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250