Godoc is a great tool for documenting packages, however it seems to be less useful when it's used against package main
. I'll see an output that only displays the notes I've written to myself using //BUG
and subdirectories.
Godoc only displays exported functions and seems to have no way to display unexported / functions from main. I would find it useful to see a list of functions in main. Since this isn't supported, I tend to shove a list of functions at the top of the package description but this feels like a workaround.
Since I have to manually update the list of functions, I often put as much code in packages as I can so it's exported and thus documented. Is this a good idea? What should I do about the list of functions in main?
Example:
COMMAND DOCUMENTATION
Package main implements a web server, template renderer and DAL for MySQL.
<filename.go>
<function>(<signature>)
main.go
main()
bootstrap() error
<more functions here>
BUGS
[filename.go] <whatever...>
SUBDIRECTORIES
auth
common
debug
storage
<more packages here>