Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Go 1.2 (devel) doesn't install godoc into bin #23281
godoc was separated from the Go installation (as was the vet tool).
The commands provided to install godoc & vet:
go install code.google.com/p/go.tools/cmd/godoc go install code.google.com/p/go.tools/cmd/vet
What's happening is that godoc & vet are not installed into a known bin path, as they are installed into $GOROOT instead of $GOPATH ($GOPATH is what most devs would export in their .bashrc or manually from terminal, as well as add to their $PATH).
Solution is to add $GOROOT export to .bashrc and $PATH, like so:
export GOROOT=`go env GOROOT` export PATH=$PATH:$GOROOT/bin
After exporting that updated $PATH into your shell env (via .bashrc or manual), you should then be able to access the godoc command.
go get worked for me
@rofrol, as I noted above, it's not that godoc isn't available, it's that what is installed isn't immediately available in your PATH. Haven't tested latest, but at the time of my post (4 months ago), updating PATH made godoc available to me, similar to how you're having to call godoc using
I installed go via Homebrew, and ended up running
and finally in your open shells:
Note, godoc required me to install Mercurial (though I thought it'd been installed a long time ago for some other dependency