Getting help and documentation
Go has both online and offline help documentation. The offline documentation is built-in for Go and is the same documentation that is hosted online. These next sections will walk you through accessing both forms of documentation.
Online Go documentation
The online documentation is available at https://golang.org/, and has all the formal documentation, specifications, and help files. Language documentation specifically is at https://golang.org/doc/, and information about the standard library is at https://golang.org/pkg/.
Offline Go documentation
Go also comes with offline documentation with the godoc
command-line tool. You can use it on the command line, or have it run a web server where it serves the same website that https://golang.org/ hosts. It is quite handy to have the full website documentation available locally. Here are a few examples that get documentation for the fmt
package. Replace fmt
with whatever package you are interested in:
# Get fmt package information...