From 116266f628c17291116b53f99f0bd7f2773bf30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 7 Jan 2017 18:41:16 +0000 Subject: [PATCH] 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- godoc/dirtrees.go | 15 --------------- godoc/index.go | 9 --------- godoc/vfs/emptyvfs_test.go | 5 +++-- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/godoc/dirtrees.go b/godoc/dirtrees.go index c631ff7e..747c8420 100644 --- a/godoc/dirtrees.go +++ b/godoc/dirtrees.go @@ -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 { diff --git a/godoc/index.go b/godoc/index.go index 725121a5..8cefd142 100644 --- a/godoc/index.go +++ b/godoc/index.go @@ -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. // diff --git a/godoc/vfs/emptyvfs_test.go b/godoc/vfs/emptyvfs_test.go index 2d8d72e6..09a6cd15 100644 --- a/godoc/vfs/emptyvfs_test.go +++ b/godoc/vfs/emptyvfs_test.go @@ -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) {