Skip to content

go/doc/comment: Inconsistent documentation about comment.Parser.LookupPackage == nil #54201

Description

@ChrisHines

What version of Go are you using (go version)?

$ go version
go version go1.19rc2 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

$ go doc comment.Parser
[...]
        // Setting LookupPackage to nil is equivalent to setting it to
        // a function that always returns "", false.
        LookupPackage func(name string) (importPath string, ok bool)
[...]
$ go doc comment.DefaultLookupPackage
package comment // import "go/doc/comment"

func DefaultLookupPackage(name string) (importPath string, ok bool)
    DefaultLookupPackage is the default package lookup function, used when
    Parser.LookupPackage is nil. It recognizes names of the packages from the
    standard library with single-element import paths, such as math, which would
    otherwise be impossible to name.
[...]

What did you expect to see?

Consistent documentation.

What did you see instead?

Contradictory statements in the documentation for comment.Parser and comment.DefaultLookupPackage regarding the behavior when comment.Parser.LookupPackage == nil.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions