mirror of
https://github.com/golang/go
synced 2024-11-18 08:14:41 -07:00
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
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"go/doc"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
@ -205,20 +204,6 @@ func (c *Corpus) newDirectory(root string, maxDepth int) *Directory {
|
||||
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) {
|
||||
if dir != nil {
|
||||
if !skipRoot {
|
||||
|
@ -1429,15 +1429,6 @@ func (c *Corpus) invalidateIndex() {
|
||||
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
|
||||
// under the file system given by root to channel c.
|
||||
//
|
||||
|
@ -5,10 +5,11 @@
|
||||
package vfs_test
|
||||
|
||||
import (
|
||||
"golang.org/x/tools/godoc/vfs"
|
||||
"golang.org/x/tools/godoc/vfs/mapfs"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"golang.org/x/tools/godoc/vfs"
|
||||
"golang.org/x/tools/godoc/vfs/mapfs"
|
||||
)
|
||||
|
||||
func TestNewNameSpace(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user