Re: [go-nuts] go get and "unrecognized import path"

1,961 views
Skip to first unread message

Brad Fitzpatrick

unread,
Jun 22, 2012, 8:23:05 PM6/22/12
to mmurr...@gmail.com, golan...@googlegroups.com
The package you're trying to install (go-socket.io) is just old.  It's using the language & libraries from before Go 1 was released, and it was never updated.

Maybe you can fork & fix it up, and send the author a pull request?

Or drop the author a note, and maybe they can fix it.


On Fri, Jun 22, 2012 at 3:24 PM, <mmurr...@gmail.com> wrote:
Hi,

I recently installed Go for the first time on my OS X Lion machine, just following the instructions on: http://golang.org/doc/install

Go appears to be installed correctly, because I can run the hello.go app without problems. However, when I try to use the "go get" command to get a third-party library, I'm seeing the following errors:

package http: unrecognized import path "http"
package json: unrecognized import path "json"
package url: unrecognized import path "url"
package utf8: unrecognized import path "utf8"
package websocket: unrecognized import path "websocket"

Searching around it seemed that this might be because I didn't set up my environment variables properly, so I tried adding this to my ~/.bash_profile and running source ~/.bash_profile:

# Google Go Lang Vars
export GOROOT=/usr/local/go
export GOOS=darwin
export GOBIN=/usr/local/go/bin
export PATH=$GOBIN:$PATH
export GOPATH=/User/mmurray/Code/go

Unfortunately this didn't fix the issue. Can anyone provide a little insight into what's going wrong?

This is the output of go env:
$ go env
GOROOT="/usr/local/go"
GOBIN="/usr/local/go/bin"
GOARCH="amd64"
GOCHAR="6"
GOOS="darwin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-common"
CGO_ENABLED="1"

And this is the output of env | grep ^GO:
$ env | grep ^GO
GOBIN=/usr/local/go/bin
GOROOT=/usr/local/go
GOOS=darwin
GOPATH=/User/mmurray/Code/go

The specific library I'm trying to install is go-socket.io, using this command:

Kyle Lemons

unread,
Jun 22, 2012, 8:34:19 PM6/22/12
to Brad Fitzpatrick, mmurr...@gmail.com, golan...@googlegroups.com
You could also try go get -fix, which should at a minimum fix up the import paths for you I believe.
Reply all
Reply to author
Forward
0 new messages