diff options
| author | Daniel Martí <mvdan@mvdan.cc> | 2018-04-13 19:39:32 +0100 |
|---|---|---|
| committer | Daniel Martí <mvdan@mvdan.cc> | 2018-05-01 05:02:43 +0000 |
| commit | 030ac2c719e14925830de5e97d4ef86b3ab5826f (patch) | |
| tree | e96dafdc86c05b046f305a10b266c68f428e0aa1 /src/database/sql/sql.go | |
| parent | 8c67ca1a99a208ab87e5eee9e1b7e3a9382eb728 (diff) | |
| download | go-030ac2c719e14925830de5e97d4ef86b3ab5826f.tar.xz | |
cmd/doc: skip directories like other go tools
It was skipping dirs starting with ".", but it was missing the "_"
prefix and the "testdata" name. From "go help packages":
Directory and file names that begin with "." or "_" are ignored
by the go tool, as are directories named "testdata".
Before the change:
$ go doc z # using src/cmd/go/testdata/testvendor/src/q/z
package z // import "."
After the fix, it falls back to the current directory, as expected when
a single argument isn't found as a package in $GOPATH.
TestMain needs a small adjustment to keep the tests working, as now
their use of cmd/doc/testdata would normally not work.
This is the second try for this fix; the first time around, we included
cmd/doc/testdata to the dirs list by sending it to the channel via a
goroutine. However, that can end up in a send to a closed channel, if
GOROOT is a very small directory tree or missing.
To avoid that possibility, include the extra directory by pre-populating
the paths list, before the walking of GOROOT and GOPATH actually starts.
Fixes #24462.
Change-Id: I3b95b6431578e0d5cbb8342f305debc4ccb5f656
Reviewed-on: https://go-review.googlesource.com/109216
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Elias Naur <elias.naur@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/database/sql/sql.go')
0 files changed, 0 insertions, 0 deletions
