tools/go
Alan Donovan 997b3545fd go/types: change {Type,Object,Selection}String to accept a Qualifier function
The optional Qualifier function determines what prefix to attach to
package-level names, enabling clients to qualify packages in different
ways, for example, using only the package name instead of its complete
path, or using the locally appropriate name for package given a set of
(possibly renaming) imports.

Prior to this change, clients wanting this behavior had to copy
hundreds of lines of complex printing logic.

Fun fact: (*types.Package).Path and (*types.Package).Name are valid
Qualifier functions.

We provide the RelativeTo helper function to create Qualifiers so that
the old behavior remains a one-liner.

Fixes golang/go#11133

Change-Id: Ibd63f639c7b3aa1738826d6165f2d810efeb8293
Reviewed-on: https://go-review.googlesource.com/11692
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-06-30 19:00:00 +00:00
..
ast/astutil go/ast/astutil: set Pos for import name 2015-05-19 23:10:16 +00:00
buildutil go/buildutil: fix usage message for -tags flag 2015-05-08 14:48:23 +00:00
callgraph go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
exact tools: add import comments. 2014-12-09 22:42:16 +00:00
gccgoimporter go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
gcimporter go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
importer go/types: remove unused scope parameter from NewSignature 2015-06-12 23:15:00 +00:00
loader go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
pointer go/pointer: fix build (provide correct args to types.NewSignature and types.Eval) 2015-06-13 01:08:28 +00:00
ssa go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
types go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
vcs go/vcs: fix bug in remote package discovery 2015-01-10 08:10:09 +00:00