mirror of https://github.com/golang/go.git
godoc: don't show testdata directories
R=golang-dev, bradfitz, dsymonds, minux.ma, rsc CC=golang-dev https://golang.org/cl/5700043
This commit is contained in:
parent
3a6a1f9e7e
commit
999c77d78a
|
|
@ -17,6 +17,11 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Conventional name for directories containing test data.
|
||||||
|
// Excluded from directory trees.
|
||||||
|
//
|
||||||
|
const testdataDirName = "testdata"
|
||||||
|
|
||||||
type Directory struct {
|
type Directory struct {
|
||||||
Depth int
|
Depth int
|
||||||
Path string // includes Name
|
Path string // includes Name
|
||||||
|
|
@ -49,7 +54,7 @@ type treeBuilder struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth int) *Directory {
|
func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth int) *Directory {
|
||||||
if b.pathFilter != nil && !b.pathFilter(path) {
|
if b.pathFilter != nil && !b.pathFilter(path) || name == testdataDirName {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue