mirror of
https://github.com/golang/go
synced 2024-11-21 23:04:39 -07:00
cmd/godoc: always include /doc files in union filesystems
Makes Path rewrites work, as the metadata was never being scanned. Fixes #3282. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/5783076
This commit is contained in:
parent
2ae8605859
commit
92d4af301e
@ -420,11 +420,17 @@ func (ns nameSpace) ReadDir(path string) ([]os.FileInfo, error) {
|
|||||||
first = dir
|
first = dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useFiles := false
|
||||||
|
|
||||||
|
// Always include all files under /doc.
|
||||||
|
if path == "/doc" || strings.HasPrefix(path, "/doc/") {
|
||||||
|
useFiles = true // always include docs
|
||||||
|
}
|
||||||
|
|
||||||
// If we don't yet have Go files in 'all' and this directory
|
// If we don't yet have Go files in 'all' and this directory
|
||||||
// has some, add all the files from this directory.
|
// has some, add all the files from this directory.
|
||||||
// Otherwise, only add subdirectories.
|
// Otherwise, only add subdirectories.
|
||||||
useFiles := false
|
if !useFiles && !haveGo {
|
||||||
if !haveGo {
|
|
||||||
for _, d := range dir {
|
for _, d := range dir {
|
||||||
if strings.HasSuffix(d.Name(), ".go") {
|
if strings.HasSuffix(d.Name(), ".go") {
|
||||||
useFiles = true
|
useFiles = true
|
||||||
|
Loading…
Reference in New Issue
Block a user