Skip to content

x/pkgsite: slightly confusing "There are no [...] in this package" placeholders #42652

Open
@mvdan

Description

@mvdan

Look at https://pkg.go.dev/github.com/multiformats/go-multicodec@master, for example. Its API just exposes an enum-like integer type, with some constants of that type, and a method on the type.

All in all, the package has a few dozen exported constants, and one exported function - a method on the type.

However, the API reads like:

Constants
There are no constants in this package.

Variables
There are no variables in this package.

Functions
There are no functions in this package.

Types
type Code
[...]

"There are no constants in this package" feels incorrect to me, just like "no functions". It's made worse by how I read the page in order - first I'm told there are no constants, which confuses me greatly as this package exposes lots of them. Only later do I find them under the "Types" section.

Godoc has none of those problems; as it does not use sections, it just jumps straight to type Code: https://godoc.org/github.com/multiformats/go-multicodec

Perhaps what I'm proposing is to omit the sections entirely, if just one section has any content. Or to omit sections which are empty, because the "There are no XXX in this package" message can be misleading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.UXIssues that involve UXD/UXR inputpkgsitepkgsite/dochtmlIssues related to package documentation in pkgsite

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions