I find Godoc a great tool to automatically generate docs. But I found that, if I define a custom type and use it in my constant definition, in the godoc HTML, the constants will be displayed under that type, but not in the package level.
Here's a simple example:
const (
Info = iota
Warning
Error
)
This will generate a "Constants" heading at the top of the godoc. But if I do the following, there will be no Constants heading for the package
type Level int
const (
Info Level = iota
Warning
Error
)
In the godoc output, the constants will be displayed under type Level
, somewhere in the middle of the document, but not at the top and not in the package level.
Is there any way to use custom types, but still put the const definitions in the package level in godoc?