tools/go/loader
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
..
testdata go/loader: improve robustness in face of input errors 2015-02-02 20:01:59 +00:00
cgo.go go.tools/*: replace $GOROOT/src/pkg with $GOROOT/src where appropriate. 2014-09-08 13:24:38 -04:00
doc.go go/loader: eliminate ImportFromBinary option and PackageCreated hook 2015-04-17 18:58:17 +00:00
example_test.go go/loader: rename Example functions to appease godoc 2015-04-17 19:40:02 +00:00
loader.go oracle: disable parser bailout 2015-05-20 20:27:48 +00:00
loader_test.go go/loader: support relative imports like the go tool does 2015-03-12 18:51:46 +00:00
stdlib_test.go go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
util.go go/loader: limit concurrency of I/O operations during parsing 2015-04-06 15:15:05 +00:00