Running vet with Go 1.4

In Travis CI environment I’m running go get to install the vet tool. Unfortunately yesterday it started erroring on the Go 1.4 build:

$ go get
	imports go/constant: unrecognized import path "go/constant"
	imports go/importer: unrecognized import path "go/importer"
	imports go/types: unrecognized import path "go/types"

In a recent commit it looks to me like the vet tool should still run on Go 1.4:

This change will ensure that the tree continues to work with go1.4.1.

Am I missing something?

(Build job succeeds on Go 1.5 and tip.)

You should not be using this version of vet. vet comes with Go by default starting from 1.5. See

If you build your library/app using different versions of Go during build process than probably you should modify the build process to run vet only once using the latest version of Go.

1 Like

Hm, okay, cool. I do not know how to do that with Travis CI. (I know it’s off topic. But if someone has already figured it out feel free to share.) Thanks!

Something like:

language: go

  - 1.5.2
  - tip

  - go test -v ./...
  - if [[ `go version` =~ go1.5 ]] ; then go vet ./... ; fi
1 Like

Only Go 1.4 is affected, and that is already excluded in that travis config.

That is true. On the other hand why would you want to run different versions of vet (or any other similar tool) multiple times during the build? I think running the latest version once should be enough.

Actually, it just started working again.

Thanks for the script idea though!

It should be fixed now:

Ah, thanks @tiffany! That explains why it magically started working again. :smile:

(PS. I see that you work at Intel; my brother works up there at Nanometrics and was just asking me the other day about using Go. He heard some teams at Intel were using it so it sparked some interest… I might have questions later about adopting Go in a corporate environment.)

vet from the tools repo has been fixed but it doesn’t change the fact that it is not the latest version and doesn’t include the latest bug fixes and improvements.

Sounds good to me, but not sure how much I can help since my group acts more like a little startup within Intel and decided to use Go. I’ll try though :).

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.