jwt-go
jwt-go copied to clipboard
go get showing this library as +incompatible in go.mod
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
??
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.
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
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
- cd $GOPATH/github.com/gfrijalva/jwt-go
- go mod init
- go build
- go get github.com/marwan-at-work/mod/cmd/mod
- mod upgrade (this will take module version to v2)
- mod upgrade (v3).
- 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
@dgrijalva any update on this?
Any fixes for this ?
Started working this when I imported "github.com/vladimiroff/jwt-go/v3" . Hope this helps some one
Are there any plans to fix this? If so, any idea when the fix will be available?
Support for go modules is coming in v4. I don't think it's possible to add support as a non-breaking change.
Thanks for the response about it coming in v4 - what is the projected timeframe of v4?
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.
github.com/dgrijalva/jwt-go v0.0.0-20180308151308-06ea1031745c // inderect
did you just use go get on that?