summaryrefslogtreecommitdiff
path: root/src/lib/go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-05-11 16:52:59 -0700
committerRobert Griesemer <gri@golang.org>2009-05-11 16:52:59 -0700
commitc5b81ea3f9797f48f7f9849cf3e20ee860a622e6 (patch)
tree012342bdc2dcdcc78e43c2df76eeae0ebd9ee9ba /src/lib/go
parent87545816058bcaa088750e5b4a1512612254f847 (diff)
downloadgolang-c5b81ea3f9797f48f7f9849cf3e20ee860a622e6.tar.gz
A couple of godoc improvements:
- sort directories before printing - apply filtering to factory functions and methods - remove a couple of unused files R=r DELTA=84 (34 added, 40 deleted, 10 changed) OCL=28657 CL=28657
Diffstat (limited to 'src/lib/go')
-rw-r--r--src/lib/go/doc/doc.go25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/lib/go/doc/doc.go b/src/lib/go/doc/doc.go
index e20db694f..25ac5bd92 100644
--- a/src/lib/go/doc/doc.go
+++ b/src/lib/go/doc/doc.go
@@ -523,11 +523,11 @@ func filterValueDocs(a []*ValueDoc, names []string) []*ValueDoc {
}
-func filterTypeDocs(a []*TypeDoc, names []string) []*TypeDoc {
+func filterFuncDocs(a []*FuncDoc, names []string) []*FuncDoc {
w := 0;
- for i, td := range a {
- if matchDecl(td.Decl, names) {
- a[w] = td;
+ for i, fd := range a {
+ if match(fd.Name, names) {
+ a[w] = fd;
w++;
}
}
@@ -535,11 +535,20 @@ func filterTypeDocs(a []*TypeDoc, names []string) []*TypeDoc {
}
-func filterFuncDocs(a []*FuncDoc, names []string) []*FuncDoc {
+func filterTypeDocs(a []*TypeDoc, names []string) []*TypeDoc {
w := 0;
- for i, fd := range a {
- if match(fd.Name, names) {
- a[w] = fd;
+ for i, td := range a {
+ match := false;
+ if matchDecl(td.Decl, names) {
+ match = true;
+ } else {
+ // type name doesn't match, but we may have matching factories or methods
+ td.Factories = filterFuncDocs(td.Factories, names);
+ td.Methods = filterFuncDocs(td.Methods, names);
+ match = len(td.Factories) > 0 || len(td.Methods) > 0;
+ }
+ if match {
+ a[w] = td;
w++;
}
}