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

cmd/go: allow use of Context in 'go list -f' #6666

Closed
philpennock opened this issue Oct 25, 2013 · 7 comments
Closed

cmd/go: allow use of Context in 'go list -f' #6666

philpennock opened this issue Oct 25, 2013 · 7 comments
Milestone

Comments

@philpennock
Copy link

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Try to investigate active build tags, release tags and other settings as visible at
time of compilation, from that tool
2. Discover that "go list" can examine build.Package, but there's no way to
reach build.Context from that
3. Write a patch

The attached patch overlays .Context into the visible attributes of Package, so that
"go list -f" can use {{.Context.ReleaseTags}}, for instance.

Attachments:

  1. go_list_dotContext.patch (599 bytes)
@rsc
Copy link
Contributor

rsc commented Oct 29, 2013

Comment 1:

This is not right. Context is global, not per-Package.
Perhaps we should allow $Context.

Labels changed: added priority-later, go1.3, removed priority-triage.

Status changed to Accepted.

@philpennock
Copy link
Author

Comment 2:

Sorry, I've just re-checked the docs and I still don't see a way to declare arbitrary
variables from outside a template, to register them as available within the template:
the only descriptions I see have them as items assigned within the template.  So I went
for layering in .Context as a pseudo-member to overcome that limitation.
If I've missed some feature of text/template, please do point me at it as I'll gladly
rewrite the patch to create a $Context variable instead!  As you say, that's much
cleaner.
Thanks.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added release-go1.3.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: removed go1.3.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added repo-main.

@gopherbot
Copy link

Comment 6:

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

@rsc
Copy link
Contributor

rsc commented Apr 9, 2014

Comment 7:

This issue was closed by revision b3a33a6.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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

3 participants