Go offers the godoc tool, which allows you to view the documentation of your packages – provided that you have included some extra information in your files.
The rule about writing documentation in Go is pretty simple and straightforward: in order to document something, you have to put one or more regular comment lines that start with // just before its declaration. This convention can be used to document functions, variables, constants, ...