Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

go get showing this library as +incompatible in go.mod #294

Open
bjm88 opened this issue Sep 21, 2018 · 11 comments
Open

go get showing this library as +incompatible in go.mod #294

bjm88 opened this issue Sep 21, 2018 · 11 comments

Comments

@bjm88
Copy link

bjm88 commented Sep 21, 2018

When upgrading from go 1.10 to 1.11 and starting to use go.mod I noticed this was an issue. I was indirectly using this by using
github.com/appleboy/gin-jwt v2.3.1
but even trying to use it directly I get this +incompatible marking.. not sure what it means or why actually...

ithub.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect

??

@dgrijalva
Copy link
Owner

Go mod requires some special flags. When I last looked at this, dep was the recommended thing and go mod was just a proposal. Since it's included in go 1.11, it would appear it's time to add support. I'll look into this over the weekend.

@bjm88
Copy link
Author

bjm88 commented Sep 21, 2018

Great thank you. There is a good video on pitfalls of dep and why they went another route. Finally having a real module Management system in go tooling is huge so glad it's being standardized

@vijay1811
Copy link

I also faced same issue after going through go mod docs I found a way to solve this. Assuming if we are using go mod then go version is 1.11

  1. cd $GOPATH/github.com/gfrijalva/jwt-go
  2. go mod init
  3. go build
  4. go get github.com/marwan-at-work/mod/cmd/mod
  5. mod upgrade (this will take module version to v2)
  6. mod upgrade (v3).
  7. Commit the changes and push it will work after this
    @dgrijalva I tried to create a pr but I was not able to push(do not have remote push rights)
    refrences: https://github.com/golang/go/wiki/Modules#semantic-import-versioning
    https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
    https://github.com/marwan-at-work/mod

@mdsolsawangwan
Copy link

@dgrijalva any update on this?

@majuansari
Copy link

Any fixes for this ?

@majuansari
Copy link

Started working this when I imported "github.com/vladimiroff/jwt-go/v3" . Hope this helps some one

@brentgriffin
Copy link

Are there any plans to fix this? If so, any idea when the fix will be available?

@dgrijalva
Copy link
Owner

Support for go modules is coming in v4. I don't think it's possible to add support as a non-breaking change.

@brentgriffin
Copy link

Thanks for the response about it coming in v4 - what is the projected timeframe of v4?

@gustavocd
Copy link

I faced some issues with go modules and jwt-go package, and taking a look in the format of other require modules inside my go.mod file I realized you can "import" them in a certain format, like so:

github.com/dgrijalva/jwt-go v0.0.0-20180308151308-06ea1031745c // inderect

20180308151308 -> this part is the date of the last commit made on master branch
06ea1031745c -> it's the first 12 letters of last commit hash on master branch.

It's working for me, but I'm waiting for v4 to get go mod support, hope it helps some else.

@David-Tenni
Copy link

github.com/dgrijalva/jwt-go v0.0.0-20180308151308-06ea1031745c // inderect

did you just use go get on that?

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

No branches or pull requests

8 participants