Last Updated: May 22, 2026
In Go, documentation isn't a separate artifact you maintain on a wiki. It lives next to the code as plain comments, and the toolchain renders it into the API reference at pkg.go.dev automatically. Write the comments well and your package gets a complete documentation site. Skip them and your package looks abandoned to anyone browsing pkg.go.dev. This chapter covers the conventions, the rendering rules, the link syntax, runnable example functions, and the tools you'll use to read and publish docs.