1
0
mirror of https://github.com/golang/go synced 2024-11-21 14:34: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:
Andrew Gerrand 2011-07-05 17:00:18 +10:00
parent 5b1658232e
commit b7db4fef22

View File

@ -30,7 +30,7 @@ type Directory struct {
func isGoFile(fi FileInfo) bool {
name := fi.Name()
return fi.IsRegular() &&
!strings.HasPrefix(name, ".") && // ignore .files
len(name) > 0 && name[0] != '.' && // ignore .files
filepath.Ext(name) == ".go"
}
@ -43,7 +43,8 @@ func isPkgFile(fi FileInfo) bool {
func isPkgDir(fi FileInfo) bool {
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
}