Skip to content

x/tools/go/analysis: pkgsite documentation for golang.org/x/tools/go/analysis/passes/* often lacks details #58950

Closed
@hyangah

Description

@hyangah

I am not sure if this is a feature request for pkgsite, or it's just because the go analysis analyzer code was structured in a way not friendly with go documentation. Analyzers often place the helpful details in Doc constant, but this long doc is hidden from documentation

https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/nilness

Screenshot 2023-03-09 at 9 10 51 AM

$ go doc
package nilness // import "golang.org/x/tools/go/analysis/passes/nilness"

Package nilness inspects the control-flow graph of an SSA function and reports
errors such as nil pointer dereferences and degenerate nil pointer comparisons.

const Doc = ...
var Analyzer = &analysis.Analyzer{ ... }

$ go doc Doc

Would be nice if the documentation page of analyzers presents sufficient details.
The pattern I saw in similar situation was to generate the package doc (doc.go) from the types but not sure if that's the best way.

cc @adonovan @golang/tools-team

Metadata

Metadata

Assignees

Labels

DocumentationIssues describing a change to documentation.FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.pkgsite

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions