Skip to content

Type conflicts between normal and gx imports of the same package #63

@sahib

Description

@sahib

Hey,

Im not using gx myself, but Im trying to use ipfs as a library. I tend to run into the following issuse: When using the same package twice, once as normal import from github and once as gx import, go will spit out an error when mixing those types:

/tmp/mh/mh.go:12: cannot use b (type 
"gx/ipfs/QmYf7ng2hG5XBtJA3tN34DQ2GUN5HNksEw1rLDkmr6vGku/go-multihash".Multihash) 
as type "github.com/jbenet/go-multihash".Multihash in assignment

See this gist for the code producing this error.

This usually happens when using a function from ipfs or libp2p that returns a multihash, multiaddr (etc.) and I need to store those in my own structures. I could probably resolve that by being forced to use gx myself or by brute force: Convert all types manually into my own types. Both solution would not be favorable for me.

I might be missing something, but gx seems to make the usage of ipfs as library harder... :-(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions