diff options
author | Elias Naur <elias.naur@gmail.com> | 2018-04-17 11:25:26 +0000 |
---|---|---|
committer | Daniel Martí <mvdan@mvdan.cc> | 2018-04-17 12:42:59 +0000 |
commit | ed68bc5918ad99c79332970938d421f05c2417fc (patch) | |
tree | 8e3ae37e790e1248ca6e7db0c0f3e5fff5708a50 /src/cmd/doc | |
parent | 9bff50575e8bf5bf84ade26f737ffa47379b4604 (diff) | |
download | go-ed68bc5918ad99c79332970938d421f05c2417fc.tar.gz go-ed68bc5918ad99c79332970938d421f05c2417fc.zip |
Revert "cmd/doc: skip directories like other go tools"
This reverts commit 49e3e436e71a54f16eb15960bd77ecf554ccc905.
Reason for revert: breaks iOS builders and Daniel can't fix for a week.
Change-Id: Ib6ff08de9540d46345dc31e1f820c8555e3de3ca
Reviewed-on: https://go-review.googlesource.com/107218
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/doc')
-rw-r--r-- | src/cmd/doc/dirs.go | 5 | ||||
-rw-r--r-- | src/cmd/doc/doc_test.go | 14 |
2 files changed, 4 insertions, 15 deletions
diff --git a/src/cmd/doc/dirs.go b/src/cmd/doc/dirs.go index 9f7920ecd9..5088f880e1 100644 --- a/src/cmd/doc/dirs.go +++ b/src/cmd/doc/dirs.go @@ -97,9 +97,8 @@ func (d *Dirs) bfsWalkRoot(root string) { continue } // Entry is a directory. - - // The go tool ignores directories starting with ., _, or named "testdata". - if name[0] == '.' || name[0] == '_' || name == "testdata" { + // No .git or other dot nonsense please. + if strings.HasPrefix(name, ".") { continue } // Remember this (fully qualified) directory for the next pass. diff --git a/src/cmd/doc/doc_test.go b/src/cmd/doc/doc_test.go index f919857067..e68fb017b9 100644 --- a/src/cmd/doc/doc_test.go +++ b/src/cmd/doc/doc_test.go @@ -16,20 +16,10 @@ import ( ) func TestMain(m *testing.M) { - // Clear GOPATH so we don't access the user's own packages in the test. + // otherwise the tests are brittle, as they may give unexpected + // output or errors when a suffix match with GOPATH takes place buildCtx.GOPATH = "" - dirsInit() - - // Add $GOROOT/src/cmd/doc/testdata explicitly so we can access its contents in the test. - // Normally testdata directories are ignored, but sending it to dirs.scan directly is - // a hack that works around the check. - testdataDir, err := filepath.Abs("testdata") - if err != nil { - panic(err) - } - go func() { dirs.scan <- testdataDir }() - os.Exit(m.Run()) } |