Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ChrisHines opened this issue Aug 2, 2022 · 1 comment
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ChrisHines
Copy link
Contributor

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.

@ChrisHines ChrisHines changed the title go/doc/comment: go/doc/comment: Inconsistent documentation about comment.Parser.LookupPackage == nil Aug 2, 2022
@dmitshur
Copy link
Contributor

dmitshur commented Aug 3, 2022

CC @rsc.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 3, 2022
@dmitshur dmitshur added this to the Backlog milestone Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants