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.
The text was updated successfully, but these errors were encountered: