With issues:
go version: 1.12.5
github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
When I update gin to v1.4.0 build error:
build myproject: cannot load github.com/ugorji/go/codec: ambiguous import: found github.com/ugorji/go/codec in multiple modules:
github.com/ugorji/go v1.1.4 (/home/harrison/Dropbox/project/go_path/pkg/mod/github.com/ugorji/[email protected]/codec)
github.com/ugorji/go/codec v0.0.0-20190320090025-2dc34c0b8780 (/home/harrison/Dropbox/project/go_path/pkg/mod/github.com/ugorji/go/[email protected])
Makefile:15: recipe for target 'server' failed
I google this error got this ugorji/go#279
@HZ89 What was your fix?
@bvisness
add this to go.mod file. but I think it should be added to go.mod of gin, not my project
replace github.com/ugorji/go v1.1.4 => github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43
gin v1.4.0 have updated the package https://github.com/gin-gonic/gin/blob/v1.4.0/go.mod
gin v1.4.0 have updated the package https://github.com/gin-gonic/gin/blob/v1.4.0/go.mod
yes, but use this go.mod, go mod tidy will get an ambiguous import.
Yeah, as far as I can tell the problem is:
So now when /go/codec is imported, it doesn鈥檛 know if it should use the old, individual module version, or the new, shared module version. And kerblam.
The replace seems to work fine for me, but I鈥檓 still not sure why I can鈥檛 replace it with the latest ugorji version. It complains about it being imported twice, which doesn鈥檛 seem like an issue to me.
@HZ89 thanks! this is solve my problem
Hi folks,
Please see https://github.com/ugorji/go/issues/299 and add your thoughts/ideas/etc. Thanks.
why cannot just remove "github.com/ugorji/go v1.1.4"?
FYI: I just released a go-codec production release - version 1.1.7 (finally)
First, it resolves the go.mod impasse where we had different import paths (github.com/ugorji/go and github.com/ugorji/go/codec) causing the ambiguous import error.
This is now fixed by leveraging import cycles to ensure that either one works well and resolves to the same bits.
Please let me know if seeing any issues. If all is well over the next few days, I will close this github issue.
Most helpful comment
Yeah, as far as I can tell the problem is:
So now when /go/codec is imported, it doesn鈥檛 know if it should use the old, individual module version, or the new, shared module version. And kerblam.
The replace seems to work fine for me, but I鈥檓 still not sure why I can鈥檛 replace it with the latest ugorji version. It complains about it being imported twice, which doesn鈥檛 seem like an issue to me.