Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use gin v1.4.0 build error ambiguous import #1897

Closed
HZ89 opened this issue May 13, 2019 · 9 comments
Closed

use gin v1.4.0 build error ambiguous import #1897

HZ89 opened this issue May 13, 2019 · 9 comments

Comments

@HZ89
Copy link

HZ89 commented May 13, 2019

  • With issues:

    • Use the search tool before opening a new issue.
    • Please provide source code and commit sha if you found a bug.
    • Review existing issues and provide feedback or react to them.
  • go version: 1.12.5

  • gin version (or commit ref):

    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=
    
  • operating system: ubuntu 18.04

Description

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/go@v1.1.4/codec)
        github.com/ugorji/go/codec v0.0.0-20190320090025-2dc34c0b8780 (/home/harrison/Dropbox/project/go_path/pkg/mod/github.com/ugorji/go/codec@v0.0.0-20190320090025-2dc34c0b8780)
Makefile:15: recipe for target 'server' failed

I google this error got this ugorji/go#279

Screenshots

@HZ89 HZ89 closed this as completed May 13, 2019
@bvisness
Copy link

@HZ89 What was your fix?

@HZ89
Copy link
Author

HZ89 commented May 15, 2019

@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

@thinkerou
Copy link
Member

gin v1.4.0 have updated the package https://github.com/gin-gonic/gin/blob/v1.4.0/go.mod

@HZ89
Copy link
Author

HZ89 commented May 16, 2019

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.

@bvisness
Copy link

bvisness commented May 16, 2019 via email

@vacoo
Copy link

vacoo commented May 19, 2019

@HZ89 thanks! this is solve my problem

@ugorji
Copy link

ugorji commented May 23, 2019

Hi folks,

Please see ugorji/go#299 and add your thoughts/ideas/etc. Thanks.

@sprzhing
Copy link

sprzhing commented Jul 2, 2019

why cannot just remove "github.com/ugorji/go v1.1.4"?

@ugorji
Copy link

ugorji commented Jul 2, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants