Reputation: 3645
While following a tutorial I hit a wall when it wanted me to run godoc. It was missing.
After a bit of searching around, I discovered:
I exported a GOPATH to my current application path /home/me/go_project/test. GOROOT was already set. (Note: GOPATH doesn't like to be set the same as GOROOT)
After that I ran "go get code.google.com/p/go.tools/cmd/godoc" and it dutifully installed the binary into my GOROOT/bin (yay!)
It also created a pkg installation under my /home/me/go_project/test/src/code.google.com/p... (Um...wat?)
I really don't need that code.google... bit under my test application; is there any reason Go would need that kept there? It doesn't alter anything in library paths or dependencies or anything, does it?
Essentially...can I just use the binary it put in GOROOT/bin and erase the stuff it put under my go_project application directory without affecting Go?
Upvotes: 1
Views: 1198
Reputation: 25245
Tbe answer to your question is yes. However if you plan on doing much Go dev you are going to want to setup a GOPATH eventually. Updating Godoc to a new version will need it. Any packages you might want for your dev work will be best installed into a GOPATH.
I would just bite the bullet and set one up.
Upvotes: 0
Reputation: 42468
Essentially...can I just use the binary it put in GOROOT/bin and erase the stuff it put under my > go_project application directory without affecting Go?
Yes. Go binaries are statically linked (almost).
Upvotes: 1