Open fische opened 6 years ago
@willhite @aboodman This is because we are not importing ipfs in the normal way. Can we import ipfs in the normal way instead of using the hash version (gx)
This is the system that ipfs itself uses. The "normal" thing doesn't really work for IPFS. I can't remember why (I think that go get
doesn't understand the gx-based paths).
I'm not sure what the right solution is.
Perhaps the ipfs samples should be in a separate repo or something.
Or have a special build process.
Hi,
It seems that
golang.org/x/net/trace
has been vendored usinggx
. This means that some packages - that have also been vendored withgx
- import it with a path that looks likegx/ipfs/$HASH/go-net/trace
.In my case, I am also using a package that imports
golang.org/x/net/trace
with the right path. Therefore, theinit
functions ofgolang.org/x/net/trace
andgx/ipfs/$HASH/go-net/trace
- which are the same one - are both called.The problem is that this function tries to register 2 handlers to the
DefaultServeMux
of thenet/http
package (i.e. https://github.com/golang/net/blob/master/trace/trace.go#L112). Thus, if it gets called twice, it will panic with the following error:http: multiple registrations for /debug/requests
.For example, the following piece of code:
... will produce the following output: