godoc: remove some unused code
Run goimports while at it. Change-Id: Ia3fea40835deb88bba0bb72c605bf02a6e407c88 Reviewed-on: https://go-review.googlesource.com/34953 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
cb538dbcf8
commit
116266f628
|
@ -7,7 +7,6 @@
|
||||||
package godoc
|
package godoc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"go/doc"
|
"go/doc"
|
||||||
"go/parser"
|
"go/parser"
|
||||||
"go/token"
|
"go/token"
|
||||||
|
@ -205,20 +204,6 @@ func (c *Corpus) newDirectory(root string, maxDepth int) *Directory {
|
||||||
return b.newDirTree(token.NewFileSet(), root, d.Name(), 0)
|
return b.newDirTree(token.NewFileSet(), root, d.Name(), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (dir *Directory) writeLeafs(buf *bytes.Buffer) {
|
|
||||||
if dir != nil {
|
|
||||||
if len(dir.Dirs) == 0 {
|
|
||||||
buf.WriteString(dir.Path)
|
|
||||||
buf.WriteByte('\n')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, d := range dir.Dirs {
|
|
||||||
d.writeLeafs(buf)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (dir *Directory) walk(c chan<- *Directory, skipRoot bool) {
|
func (dir *Directory) walk(c chan<- *Directory, skipRoot bool) {
|
||||||
if dir != nil {
|
if dir != nil {
|
||||||
if !skipRoot {
|
if !skipRoot {
|
||||||
|
|
|
@ -1429,15 +1429,6 @@ func (c *Corpus) invalidateIndex() {
|
||||||
c.refreshMetadata()
|
c.refreshMetadata()
|
||||||
}
|
}
|
||||||
|
|
||||||
// indexUpToDate() returns true if the search index is not older
|
|
||||||
// than any of the file systems under godoc's observation.
|
|
||||||
//
|
|
||||||
func (c *Corpus) indexUpToDate() bool {
|
|
||||||
_, fsTime := c.fsModified.Get()
|
|
||||||
_, siTime := c.searchIndex.Get()
|
|
||||||
return !fsTime.After(siTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
// feedDirnames feeds the directory names of all directories
|
// feedDirnames feeds the directory names of all directories
|
||||||
// under the file system given by root to channel c.
|
// under the file system given by root to channel c.
|
||||||
//
|
//
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
package vfs_test
|
package vfs_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"golang.org/x/tools/godoc/vfs"
|
|
||||||
"golang.org/x/tools/godoc/vfs/mapfs"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"golang.org/x/tools/godoc/vfs"
|
||||||
|
"golang.org/x/tools/godoc/vfs/mapfs"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewNameSpace(t *testing.T) {
|
func TestNewNameSpace(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue