summaryrefslogtreecommitdiff
path: root/src/cmd/godoc/dirtrees.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-01-30 15:38:19 +0100
committerOndřej Surý <ondrej@sury.org>2012-01-30 15:38:19 +0100
commit4cecda6c347bd6902b960c6a35a967add7070b0d (patch)
treea462e224ff41ec9f3eb1a0b6e815806f9e8804ad /src/cmd/godoc/dirtrees.go
parent6c7ca6e4d4e26e4c8cbe0d183966011b3b088a0a (diff)
downloadgolang-4cecda6c347bd6902b960c6a35a967add7070b0d.tar.gz
Imported Upstream version 2012.01.27upstream-weekly/2012.01.27
Diffstat (limited to 'src/cmd/godoc/dirtrees.go')
-rw-r--r--src/cmd/godoc/dirtrees.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/godoc/dirtrees.go b/src/cmd/godoc/dirtrees.go
index 7595ef96f..c61f791dc 100644
--- a/src/cmd/godoc/dirtrees.go
+++ b/src/cmd/godoc/dirtrees.go
@@ -8,10 +8,10 @@ package main
import (
"bytes"
- "go/doc"
"go/parser"
"go/token"
"log"
+ "os"
"path/filepath"
"strings"
"unicode"
@@ -25,21 +25,21 @@ type Directory struct {
Dirs []*Directory // subdirectories
}
-func isGoFile(fi FileInfo) bool {
+func isGoFile(fi os.FileInfo) bool {
name := fi.Name()
- return fi.IsRegular() &&
+ return !fi.IsDir() &&
len(name) > 0 && name[0] != '.' && // ignore .files
filepath.Ext(name) == ".go"
}
-func isPkgFile(fi FileInfo) bool {
+func isPkgFile(fi os.FileInfo) bool {
return isGoFile(fi) &&
!strings.HasSuffix(fi.Name(), "_test.go") // ignore test files
}
-func isPkgDir(fi FileInfo) bool {
+func isPkgDir(fi os.FileInfo) bool {
name := fi.Name()
- return fi.IsDirectory() && len(name) > 0 &&
+ return fi.IsDir() && len(name) > 0 &&
name[0] != '_' && name[0] != '.' // ignore _files and .files
}
@@ -135,7 +135,7 @@ func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth i
i = 3 // none of the above
}
if 0 <= i && i < len(synopses) && synopses[i] == "" {
- synopses[i] = firstSentence(doc.CommentText(file.Doc))
+ synopses[i] = firstSentence(file.Doc.Text())
}
}
}