Hi,
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: