Commit ed68bc59 authored by Elias Naur's avatar Elias Naur Committed by Daniel Martí

Revert "cmd/doc: skip directories like other go tools"

This reverts commit 49e3e436.

Reason for revert: breaks iOS builders and Daniel can't fix for a week.

Change-Id: Ib6ff08de9540d46345dc31e1f820c8555e3de3ca
Reviewed-on: https://go-review.googlesource.com/107218Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9bff5057
...@@ -97,9 +97,8 @@ func (d *Dirs) bfsWalkRoot(root string) { ...@@ -97,9 +97,8 @@ func (d *Dirs) bfsWalkRoot(root string) {
continue continue
} }
// Entry is a directory. // Entry is a directory.
// No .git or other dot nonsense please.
// The go tool ignores directories starting with ., _, or named "testdata". if strings.HasPrefix(name, ".") {
if name[0] == '.' || name[0] == '_' || name == "testdata" {
continue continue
} }
// Remember this (fully qualified) directory for the next pass. // Remember this (fully qualified) directory for the next pass.
......
...@@ -16,20 +16,10 @@ import ( ...@@ -16,20 +16,10 @@ import (
) )
func TestMain(m *testing.M) { 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 = "" buildCtx.GOPATH = ""
dirsInit() 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()) os.Exit(m.Run())
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment