I'm having a look at Go however i'm stuck at the very first hurdle. Whenever I run 'go install' I get the following error:
go install: no install location for directory /Users/jamie/Sites/gocode/src/jd/hello outside GOPATH
In all of the other posts I've seen about this it's usually because the user hasn't set a GOPATH or is trying to run go install outside of the GOPATH. I have set up my GOPATH and my code is in my GOPATH.
Here is my directory structure:
/Users/jamie/Sites/gocode
/bin
/src
/jd
/hello
hello.go
I'm trying to run 'go install' from inside /Users/jamie/Sites/gocode/src/jd/hello. Here is my GOPATH:
$ echo $GOPATH
/Users/james/Sites/gocode
And finally here is hello.go:
package main
import "fmt"
func main() {
fmt.Println("Hello there")
}
What am I doing wrong here?
Edit: go env:
$ go env
GOARCH="386"
GOBIN=""
GOCHAR="8"
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/james/Sites/gocode"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_386"
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread -fno-common"
CXX="g++"
CGO_ENABLED="1"
Thanks!