Skip to content

cmd/doc: load packages with Go command logic rather than using go/build #34750

@jayconrod

Description

@jayconrod

cmd/doc currently uses go/build.Import to locate and import packages. It should use golang.org/x/tools/go/packages.

This may be a little complicated because cmd/doc supports a number of shorthand formats for specifying the package to display documentation for, so we may not have the full package path. However, go/build has limited support for modules, and we're considering deprecating it eventually. Using go/packages could also simplify cmd/doc, since it wouldn't need code for parsing Go source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions