1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:36:10 -07:00
go/godoc
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
..
analysis go/types: change {Type,Object,Selection}String to accept a Qualifier function 2015-06-30 19:00:00 +00:00
redirect godoc/redirect: update the rules for /cl/ redirect 2014-12-22 03:14:31 +00:00
static tools/godoc: Fix indentation in doc contents 2015-06-28 23:35:27 +00:00
util tools: add import comments. 2014-12-09 22:42:16 +00:00
vfs godoc/vfs: close file on error 2015-06-01 03:28:17 +00:00
cmdline_test.go godoc: add missing copyright 2015-04-27 04:29:37 +00:00
cmdline.go godoc: add missing copyright 2015-04-27 04:29:37 +00:00
corpus.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
dirtrees.go cmd/godoc: do not apply package path restrictions onto GOROOT when indexing. 2014-10-23 09:34:01 -07:00
format.go go.tools/godoc: Fix jump-to-line in source view. 2013-08-01 11:52:25 +10:00
godoc_test.go go.tools/godoc: deal with fallout from $GOROOT/src/pkg -> $GOROOT/src renaming. 2014-09-10 09:02:54 -04:00
godoc.go tools/godoc: Mobile-friendly site design 2015-06-24 07:57:00 +00:00
index_test.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
index.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
linkify.go godoc: remove the last of the global variables, unexport Server 2013-07-19 10:27:53 +10:00
meta.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
page.go godoc: set expvar for http.ResponseWriter errors. 2014-01-29 10:53:45 -05:00
parser.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
pres.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
search.go godoc: Fix dereference of nil *SearchResult. 2014-02-20 11:26:05 -05:00
server_test.go godoc: add missing copyright 2015-04-27 04:29:37 +00:00
server.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
snippet.go godoc: remove more global variables 2013-07-18 13:14:09 +10:00
spec.go godoc: move bulk of the code to the package 2013-07-17 17:09:54 +10:00
spot.go godoc: add search results that point to documentation instead of source. 2013-11-21 11:55:42 -05:00
tab.go godoc: add missing copyright 2015-04-27 04:29:37 +00:00
template.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00