Browse the Go Documentation Without an Internet Connection

Posted in documentation with tags tools -

If you travel a lot (or if you live in the boondocks, like I do), then you’ll probably find yourself in a situation where you need to browse the documentation for the packages in the Go standard library, but the internet connection is terrible or just plain non-existent.

To get around this, run a godoc server locally on an available port. I’ve often seen people use 6060 or 4040.

godoc -http=":6060"

This gives you access to all the installed packages at localhost:6060/pkg: the Go standard library, as well as any other packages you may have installed.