Understanding the output of "go get"

510 views
Skip to first unread message

Joshua Humphries

unread,
Apr 22, 2017, 10:45:05 AM4/22/17
to golang-nuts
Hello, fellow Gophers!

I have some code for which "go get -t -v" is suddenly failing for Go 1.6, complaining about a reference to the "context" package (added in 1.7).

I haven't changed any of my imports, so this means a dependency has been updated to suddenly require Go 1.7. I'm trying to figure out which package that is, and the output of "go get" doesn't seem to help much.

I develop on a Mac with OS X Sierra, so I sadly cannot really use Go 1.6 to troubleshoot in my local environment (the failing Go 1.6 build is running in Travis.) What I have tried is cleaning out my GOPATH and running the same "go get" command. Since I am running Go 1.7, it succeeds of course.

But I then used the godepgraph tool to figure out what was referencing the context package. And nothing was, except for golang.org/x/net/context (which does so conditionally, and would not depend on it in a Go 1.6 environment). So I'm back to square one at figuring out which package is suddenly Go 1.6-averse.

So if anyone has advice or other strategies for pinpointing my problematic dependency, I would be grateful. I am certain that "go get" has the information I seek -- it just doesn't print it out, even with the "-v" flag.

For reference, here's the output of "go get". Based on lines around the error message, I guessed it may have been golang.org/x/text/unicode/norm, but I don't see any imports of "context" in that package:

Parsing meta tags from https://golang.org/x/net/context?go-get=1 (status code 200)
get "golang.org/x/net/context": found meta tag main.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at https://golang.org/x/net/context?go-get=1
get "golang.org/x/net/context": verifying non-authoritative meta tag
Parsing meta tags from https://golang.org/x/net?go-get=1 (status code 200)
golang.org/x/net (download)
Parsing meta tags from https://google.golang.org/grpc?go-get=1 (status code 200)
get "google.golang.org/grpc": found meta tag main.metaImport{Prefix:"google.golang.org/grpc", VCS:"git", RepoRoot:"https://github.com/grpc/grpc-go"} at https://google.golang.org/grpc?go-get=1
Parsing meta tags from https://golang.org/x/text/secure/bidirule?go-get=1 (status code 200)
get "golang.org/x/text/secure/bidirule": verifying non-authoritative meta tag
Parsing meta tags from https://golang.org/x/text?go-get=1 (status code 200)
Parsing meta tags from https://golang.org/x/text/unicode/norm?go-get=1 (status code 200)
get "golang.org/x/text/unicode/norm": verifying non-authoritative meta tag
package context: unrecognized import path "context" (import path does not begin with hostname)
get "google.golang.org/genproto/googleapis/rpc/status": verifying non-authoritative meta tag
Parsing meta tags from https://google.golang.org/genproto?go-get=1 (status code 200)

David Peacock

unread,
Apr 22, 2017, 12:58:43 PM4/22/17
to Joshua Humphries, golang-nuts
On Sat, Apr 22, 2017 at 7:54 AM, Joshua Humphries <jh...@bluegosling.com> wrote:
I have some code for which "go get -t -v" is suddenly failing for Go 1.6, complaining about a reference to the "context" package (added in 1.7).

I haven't changed any of my imports, so this means a dependency has been updated to suddenly require Go 1.7. I'm trying to figure out which package that is, and the output of "go get" doesn't seem to help much.

I develop on a Mac with OS X Sierra, so I sadly cannot really use Go 1.6 to troubleshoot in my local environment (the failing Go 1.6 build is running in Travis.) What I have tried is cleaning out my GOPATH and running the same "go get" command. Since I am running Go 1.7, it succeeds of course.

Have you tried `go get -u` to attempt an automatic update of the imports?  Is that available in 1.6?

Joshua Humphries

unread,
Apr 22, 2017, 2:08:42 PM4/22/17
to golang-nuts, jh...@bluegosling.com
I did indeed try that. Same result as wiping everything from my GOPATH (except the source I am immediately working on) and doing a normal "go get ...".
Reply all
Reply to author
Forward
0 new messages