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/types: Document that the caller must populate desired fields of types.Info #12787

creachadair opened this issue Sep 29, 2015 · 4 comments


Copy link

In the comment for the go/types.(*Config).Check method, it says:

Check type-checks a package and returns the resulting package object, the first error if any, and if info != nil, additional type information.

What it does not mention is that the caller must explicitly populate any of the map fields of this type that are to be filled in—it is not sufficient to simply pass a *types.Info. Ideally the documentation would make this explicit, say perhaps:

The type-checker populates each non-nil map field with the corresponding type information. If a given map field is nil, its information will be discarded.

or words to that effect. I'll be happy to send a PR for this (or similar), if we can agree on the wording.

@griesemer griesemer self-assigned this Sep 29, 2015
Copy link

Actually, this is documented with the Info struct:

"Only the information for which a map is provided is collected."

Copy link

It might be helpful to at least mention that in the Check documentation

On Tue, Sep 29, 2015 at 12:49 PM, Robert Griesemer <


Closed #12787 #12787.

Copy link

Will consider as part of another CL.

Copy link

CL mentions this issue.

griesemer added a commit that referenced this issue Sep 29, 2015
For #12787.

Change-Id: I921d01c8d7d97f3453b25e6d2241a43c5d64f53b
Reviewed-by: Alan Donovan <>
@golang golang locked and limited conversation to collaborators Sep 28, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants