0

We are running a spike to determine how or indeed if we can migrate our stack to Go modules. We depend on v2.0.0 https://github.com/gbrlsnchs/jwt but it is neither converted to a module itself nor does it adhere to the Go convention of putting major versions under sub-folders.

What are our options here when it come to converting our internal package to a module that has this dependency?

Myles McDonnell
  • 12,943
  • 17
  • 66
  • 116
  • Have you asked the package authors to provide the package in Go module and version form? – peterSO Nov 27 '18 at 18:19
  • Not yet. I'm hoping a mixed model is somehow possible so that package authors can migrate in their own time..otherwise we are bound by every single one of our direct and indirect dependencies as I currently understand it? – Myles McDonnell Nov 27 '18 at 19:46
  • It IS a go module, with latest tag v2.0.0. Just import "github.com/gbrlsnchs/jwt/v2" (you just call it by `jwt`) in their github they have an example. Or I didn't understand your question... – oren Nov 29 '18 at 18:57

1 Answers1

1

github.com/gbrlsnchs/jwt at v2.0.0 has a go.mod file that indicates that its canonical import path is github.com/gbrlsnchs/jwt/v2.

Update your import statements to use that path — which should also work in GOPATH mode in Go 1.9.7, 1.10.3, 1.11.0, and above using “minimal module compatibility” — and you should be good to go.

bcmills
  • 4,391
  • 24
  • 34