diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
commit | 28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch) | |
tree | 32944e18b23f7fe4a0818a694aa2a6dfb1835463 /src/cmd/godoc/index.go | |
parent | e836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff) | |
download | golang-upstream/59.tar.gz |
Imported Upstream version 59upstream/59
Diffstat (limited to 'src/cmd/godoc/index.go')
-rw-r--r-- | src/cmd/godoc/index.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/cmd/godoc/index.go b/src/cmd/godoc/index.go index 5938d0b74..e0c89e794 100644 --- a/src/cmd/godoc/index.go +++ b/src/cmd/godoc/index.go @@ -45,7 +45,6 @@ import ( "go/token" "go/scanner" "index/suffixarray" - "io/ioutil" "os" "path/filepath" "regexp" @@ -624,7 +623,7 @@ func pkgName(filename string) string { // failed (that is, if the file was not added), it returns file == nil. func (x *Indexer) addFile(filename string, goFile bool) (file *token.File, ast *ast.File) { // open file - f, err := os.Open(filename) + f, err := fs.Open(filename) if err != nil { return } @@ -727,12 +726,12 @@ func isWhitelisted(filename string) bool { } -func (x *Indexer) visitFile(dirname string, f *os.FileInfo, fulltextIndex bool) { +func (x *Indexer) visitFile(dirname string, f FileInfo, fulltextIndex bool) { if !f.IsRegular() { return } - filename := filepath.Join(dirname, f.Name) + filename := filepath.Join(dirname, f.Name()) goFile := false switch { @@ -745,7 +744,7 @@ func (x *Indexer) visitFile(dirname string, f *os.FileInfo, fulltextIndex bool) } goFile = true - case !fulltextIndex || !isWhitelisted(f.Name): + case !fulltextIndex || !isWhitelisted(f.Name()): return } @@ -804,7 +803,7 @@ func NewIndex(dirnames <-chan string, fulltextIndex bool) *Index { // index all files in the directories given by dirnames for dirname := range dirnames { - list, err := ioutil.ReadDir(dirname) + list, err := fs.ReadDir(dirname) if err != nil { continue // ignore this directory } @@ -902,7 +901,7 @@ func isIdentifier(s string) bool { // identifier, Lookup returns a LookupResult, and a list of alternative // spellings, if any. If the query syntax is wrong, an error is reported. func (x *Index) Lookup(query string) (match *LookupResult, alt *AltWords, err os.Error) { - ss := strings.Split(query, ".", -1) + ss := strings.Split(query, ".") // check query syntax for _, s := range ss { @@ -955,7 +954,7 @@ func (list positionList) Swap(i, j int) { list[i], list[j] = list[j], list[ // unique returns the list sorted and with duplicate entries removed func unique(list []int) []int { - sort.SortInts(list) + sort.Ints(list) var last int i := 0 for _, x := range list { |