ugorji / go

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

moved go.mod to root level #263

Closed savaki closed 6 years ago

savaki commented 6 years ago

I believe the go.mod file that you have at the child level is causing issue when go modules is used outside the GOPATH. Here's what happens when I attempt to use gin-gonic:

../../../go/pkg/mod/github.com/gin-gonic/gin@v1.3.0/binding/msgpack.go:12:2: unknown import path "github.com/ugorji/go/codec": ambiguous import: found github.com/ugorji/go/codec in multiple modules:
    github.com/ugorji/go v1.1.1 (/Users/matt/go/pkg/mod/github.com/ugorji/go@v1.1.1/codec)
    github.com/ugorji/go/codec v0.0.0-20180831062425-e253f1f20942 (/Users/matt/go/pkg/mod/github.com/ugorji/go/codec@v0.0.0-20180831062425-e253f1f20942)

I think what's happening is that it's considering the go.mod file you put in the codec directory a separate module that's in conflict with github.com/ugorji/go/codec.

ugorji commented 6 years ago

I think the spec is clear on where go.mod should reside. If it's different, please let me know.

ugorji commented 6 years ago

Clarifying my last response:

The module spec says that you can have multiple modules per repository, and just put the go.mod file at the package level (not top level). I do not see anything to show that this is incorrect. Given that, I cannot accept this PR.

Please add comments, links, snippets, etc defending your position if you disagree, and I can re-open and review.