ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.85k stars 295 forks source link

Go Mod Issue #318

Closed 1995parham closed 4 years ago

1995parham commented 5 years ago

I have got the following error by using the go module:

        github.com/ugorji/go/codec: ambiguous import: found github.com/ugorji/go/codec in multiple modules:
        github.com/ugorji/go v1.1.4 (/home/parham/Documents/Go/pkg/mod/github.com/ugorji/go@v1.1.4/codec)
        github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 (/home/parham/Documents/Go/pkg/mod/github.com/ugorji/go/codec@v0.0.0-20181204163529-d75b2dcb6bc8)

I think there is no need to have go.mod in the project root.

sachinagada commented 5 years ago

Try adding github.com/ugorji/go v1.1.7 to your go.mod file.

dlaguerta commented 5 years ago

Check out #319 -- I believe this circular dependency in /codec (relying on its root mod) causes this issue

1995parham commented 5 years ago

@dlaguerta Yes I agree with you, and I think they must remove dependencies from go.mod that is on the project root.

ugorji commented 5 years ago

Please read https://github.com/ugorji/go/issues/299

It's important to know the context and history, so you know what influenced the decision to make the committed fix. This also helps you make informed comments or offer informed changes.

I'm open to whatever is the best path moving forward, and am fully open to better ways forward.