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

x/tools/go/types: New needs to be able to use imports #6259

Closed
robpike opened this issue Aug 27, 2013 · 6 comments
Closed

x/tools/go/types: New needs to be able to use imports #6259

robpike opened this issue Aug 27, 2013 · 6 comments

Comments

@robpike
Copy link
Contributor

robpike commented Aug 27, 2013

types.New lets you write:

types.New("interface{ Error() string }")

but not

types.New("interface{Format(f fmt.State, c rune)}")

because fmt is not defined in the universe scope.

New would be much more useful if one could provide it (or some companion function) a
list of imports.
@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added repo-tools.

@gopherbot
Copy link

Comment 4:

CL https://golang.org/cl/51380044 references this issue.

@gopherbot
Copy link

Comment 5:

CL https://golang.org/cl/51380044 references this issue.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title go.tools/go/types: New needs to be able to use imports x/tools/go/types: New needs to be able to use imports Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
@griesemer
Copy link
Contributor

  • types.New is problematic for various reason and we are planning to remove it.
  • cmd/vet is not relying on types.New anymore but does the actual import and lookup needed.

Will not fix.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants