mirror of
https://github.com/golang/go
synced 2024-11-22 00:04:41 -07:00
godoc: ignore directories that begin with '.'
Fixes #2017. R=golang-dev, r CC=golang-dev https://golang.org/cl/4675047
This commit is contained in:
parent
5b1658232e
commit
b7db4fef22
@ -30,7 +30,7 @@ type Directory struct {
|
|||||||
func isGoFile(fi FileInfo) bool {
|
func isGoFile(fi FileInfo) bool {
|
||||||
name := fi.Name()
|
name := fi.Name()
|
||||||
return fi.IsRegular() &&
|
return fi.IsRegular() &&
|
||||||
!strings.HasPrefix(name, ".") && // ignore .files
|
len(name) > 0 && name[0] != '.' && // ignore .files
|
||||||
filepath.Ext(name) == ".go"
|
filepath.Ext(name) == ".go"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,8 @@ func isPkgFile(fi FileInfo) bool {
|
|||||||
|
|
||||||
func isPkgDir(fi FileInfo) bool {
|
func isPkgDir(fi FileInfo) bool {
|
||||||
name := fi.Name()
|
name := fi.Name()
|
||||||
return fi.IsDirectory() && len(name) > 0 && name[0] != '_'
|
return fi.IsDirectory() && len(name) > 0 &&
|
||||||
|
name[0] != '_' && name[0] != '.' // ignore _files and .files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user