Skip to content

Commit

Permalink
readme: add instructions for bypassing gomod proxy.
Browse files Browse the repository at this point in the history
We do not want to contribute to informing Google of every single user that uses go-libp2p, thanks.

Also, the default proxy (proxy.golang.org) contains old and deprecated `+incompatible` versions that the Go toolchain selects over the more recent go-modded versions.

See golang/go#34189 and golang/go#34217.
  • Loading branch information
raulk authored Oct 6, 2019
1 parent c168728 commit cda548a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ You can start using go-libp2p in your Go application simply by adding imports fr
import "github.com/libp2p/go-libp2p"
```

The next time you run `go get` or `go build`, the Go build tools will look for [available releases](https://github.com/libp2p/go-libp2p/releases), and will pick the highest available one.
Run `go get` or `go build`, excluding the libp2p repos from Go modules proxy usage. You only need to do this the first time you import go-libp2p to make sure you latch onto the correct version lineage (see [golang/go#34189](https://github.com/golang/go/issues/34189) for context):

```sh
$ GOPRIVATE='github.com/libp2p/*' go get ./...
```

The Go build tools will look for [available releases](https://github.com/libp2p/go-libp2p/releases), and will pick the highest available one.

As new releases of go-libp2p are made available, you can upgrade your application by manually editing your `go.mod` file, or using the [Go tools](https://golang.org/cmd/go/#hdr-Maintaining_module_requirements) to maintain module requirements.

Expand Down

2 comments on commit cda548a

@minzilla
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use bash

$ GOPRIVATE='github.com/libp2p/*' go get ./...

But got

unrecognized import path "go-common/app/interface/main/kvo/model": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/kvo/service": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/kvo/dao": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/kvo/model/module": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/laser/conf": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/laser/http": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/laser/model": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/laser/service": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/laser/dao": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/conf": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/server/http": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/tool/datacenter": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/dao/cache": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/dao/global": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/tool/cache": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/model": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/tool/validate": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/service": import path does not begin with hostname
unrecognized import path "go-common/app/interface/main/mcn/dao/bfs": import path does not begin with hostname

@Stebalien
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liguiz

  • Please file issues, don't comment on commits.
  • That looks like a bug in the code you're trying to compile, not libp2p.

Please sign in to comment.