Minimal required go version is not documented

Labels: Easy pick

Timeline

Augustin Trancart (autra) opened

When installing the project with go get on ubuntu 16.04, I have the following error:


ᐅ go get -u github.com/MichaelMure/git-bug
package context: unrecognized import path "context" (import path does not begin with hostname)
package github.com/MichaelMure/git-bug/vendor/github.com/shurcooL/go/ctxhttp: no buildable Go source files in /home/augustin/.go/src/github.com/MichaelMure/git-bug/vendor/github.com/shurcooL/go/ctxhttp

Indee my go version is 1.6.2, and apparently context appeared in go 1.7.

I didn't open a PR because I don't know what's the best way for this : can it be constrained in the Gopkg.toml? Or can we only document this?

thanks!

Augustin Trancart (autra) changed the title from Minimal required go version is not documented to Minimal required go version is not documented

Michael Muré (MichaelMure) commented

The thing is, I actually don't know which version is the minimum. I personally use go 1.10.4.

It seems possible to easily force a constraint more explicitly using https://github.com/theckman/goconstraint.

Michael Muré (MichaelMure) added label Easy pick

Michael Muré (MichaelMure) commented

After testing with Travis:

  • go < 1.4 fails because go:generate is missing
  • go < 1.7 fails because Context is not yet in the standard library
  • go 1.7 fails because sort.Slice doesn't exist yet

So, minimal version is go 1.8 which should be fairly easy to get. I added a check in the code with goconstraint.

Michael Muré (MichaelMure) closed the bug