Monday, August 18, 2025

Previewing Go package documentation

While developing Windigo, I’m using the auto-generated docs at pkg.go.dev. It’s not perfect, but it’s something.

I didn’t know, however, a way to preview the generated docs while still developing the library.

Go 1.25 brought a new go doc option which allows us to preview the documentation by creating a temporary, virtual server. It downloads a whole bunch of packages, builds them, and then effectively displays the current docs:

go doc -http

It actually works. Thanks to this guy who told me that.

No comments: