I would recommend setting up an environment consistent with the recommendations in the "Organizing your code" section of the language documentation.
First, choose a top level directory (I tend to use ~/devel
), and set the value of your GOPATH environment var to that location, and add the GOPATH/bin dir to your path. Put it in your the appropriate session startup file (~/.bash_profile
or similar). In my case, I would put these lines in that file:
export GOPATH=$HOME/devel
export PATH=$GOPATH/bin:$PATH
Quoting from the documentation:
To give you an idea of how a workspace looks in practice, here's an example:
bin/
hello # command executable
outyet # command executable
pkg/
linux_amd64/
github.com/golang/example/
stringutil.a # package object
src/
github.com/golang/example/
.git/ # Git repository metadata
hello/
hello.go # command source
outyet/
main.go # command source
main_test.go # test source
stringutil/
reverse.go # package source
reverse_test.go # test source
golang.org/x/image/
.git/ # Git repository metadata
bmp/
reader.go # package source
writer.go # package source
... (many more repositories and packages omitted) ...
Next, clone your git repo into the appropriate path under the $GOPATH/src tree. In my case it would be $GOPATH/src/github.com/user/repo
.
Now you should be all set to work on both go and python code without much trouble.