google / subcommands

Go subcommand library.
Apache License 2.0
749 stars 48 forks source link

package context: unrecognized import path "context" (import path does not begin with hostname) #6

Closed patrickshuff closed 7 years ago

patrickshuff commented 7 years ago

It looks like a71b91e238406bd68766ee52db63bebedce0e9f6 broke using this library in, at least, go1.6.3

$ go get github.com/google/subcommands    
package context: unrecognized import path "context" (import path does not begin with hostname)

My golang version:

$ go version  
go version go1.6.3 linux/amd64

$ rpm -q golang
golang-1.6.3-3.fc24.x86_64

I'm using the latest golang in the fedora24 yum repos

patrickshuff commented 7 years ago

I'm guessing the answer is going to be: "Use a newer version of golang". If that is the case, please have the golang folks that maintain the upstream fedora rpms to update the version.

thomasf commented 7 years ago

I install Go under my ~ to avoid having to wait for distro maintainers. You can also extract install the golang.org binary distribution directly into /usr/local/ if you don't want to compile it..

adjackura commented 7 years ago

Pretty much what Thomas said, the place to get Go is here: golang.org/dl. Most distro's prefer stability of the platform over up to date packages.

patrickshuff commented 7 years ago

That's the answer I expected.

Just an anecdote: For new people to golang (e.g. me) who are coming to play with a new language, yum install it on their server with the intention of building a commandline tool, google for "subcommands in golang", and land on this page, then mess around for 45 minutes trying to understand what "context" is and why it's missing, this is going to be frustrating. Not everyone is going to be as willing to stick around.

This is a pretty big tradeoff to make -- basically excluding anyone in the yum ecosystem that wants to use golang can't use your subcommand package unless they download and compile locally. That is a bummer.