1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:04:44 -07:00

go/build: undo CL 7129048

This broke 'godoc net/http'.

TBR=adg
CC=golang-dev
https://golang.org/cl/7235052
This commit is contained in:
Russ Cox 2013-01-28 12:49:26 -05:00
parent 2cd5b01454
commit a8e0a75726
2 changed files with 4 additions and 1 deletions

View File

@ -322,7 +322,9 @@ func (p *Package) IsCommand() bool {
// the named directory.
func (ctxt *Context) ImportDir(dir string, mode ImportMode) (*Package, error) {
p, err := ctxt.Import(".", dir, mode)
if err == nil && !ctxt.isDir(p.Dir) {
// TODO(rsc,adg): breaks godoc net/http. Not sure why.
// See CL 7232047 and issue 4696.
if false && err == nil && !ctxt.isDir(p.Dir) {
err = fmt.Errorf("%q is not a directory", p.Dir)
}
return p, err

View File

@ -92,6 +92,7 @@ func TestLocalDirectory(t *testing.T) {
// golang.org/issue/3248
func TestBogusDirectory(t *testing.T) {
return // See issue 4696.
const dir = "/foo/bar/baz/gopher"
_, err := ImportDir(dir, FindOnly)
want := fmt.Sprintf("%q is not a directory", filepath.FromSlash(dir))