mirror of
https://github.com/golang/go
synced 2024-11-13 18:20:32 -07:00
godoc: minor internal fix
The value of the internal flag includeNonGoFile really is the value of the fulltextIndex flag. R=rsc CC=golang-dev https://golang.org/cl/4044052
This commit is contained in:
parent
7db904c1f6
commit
ea2c6a3e59
@ -430,7 +430,6 @@ func (a *AltWords) filter(s string) *AltWords {
|
|||||||
// Indexer
|
// Indexer
|
||||||
|
|
||||||
// Adjust these flags as seems best.
|
// Adjust these flags as seems best.
|
||||||
const includeNonGoFiles = true
|
|
||||||
const includeMainPackages = true
|
const includeMainPackages = true
|
||||||
const includeTestFiles = true
|
const includeTestFiles = true
|
||||||
|
|
||||||
@ -728,7 +727,7 @@ func isWhitelisted(filename string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (x *Indexer) visitFile(dirname string, f *os.FileInfo) {
|
func (x *Indexer) visitFile(dirname string, f *os.FileInfo, fulltextIndex bool) {
|
||||||
if !f.IsRegular() {
|
if !f.IsRegular() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -746,7 +745,7 @@ func (x *Indexer) visitFile(dirname string, f *os.FileInfo) {
|
|||||||
}
|
}
|
||||||
goFile = true
|
goFile = true
|
||||||
|
|
||||||
case !includeNonGoFiles || !isWhitelisted(f.Name):
|
case !fulltextIndex || !isWhitelisted(f.Name):
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -811,7 +810,7 @@ func NewIndex(dirnames <-chan string, fulltextIndex bool) *Index {
|
|||||||
}
|
}
|
||||||
for _, f := range list {
|
for _, f := range list {
|
||||||
if !f.IsDirectory() {
|
if !f.IsDirectory() {
|
||||||
x.visitFile(dirname, f)
|
x.visitFile(dirname, f, fulltextIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user