This reverts commit
7af2ce3f159760033c903b3730bfb5995b4edd40.
The commit had a wrong prefix in the description line, probably
misreconginized something. As a result it broke golang.org/x/tools/godoc
and golang.org/x/tools/cmd/godoc like the following:
--- FAIL: TestCLI (10.90s)
--- FAIL: TestWeb (13.74s)
FAIL
FAIL golang.org/x/tools/cmd/godoc 36.428s
--- FAIL: TestCommandLine (0.00s)
FAIL
FAIL golang.org/x/tools/godoc 0.068s
Change-Id: I362a862a4ded8592dec7488a28e7a256adee148f
Reviewed-on: https://go-review.googlesource.com/23076
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
// ImportDir is like Import but processes the Go package found in
// 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) {
- err = fmt.Errorf("%q is not a directory", p.Dir)
- }
- return p, err
+ return ctxt.Import(".", dir, mode)
}
// NoGoError is the error used by Import to describe a directory
package build
import (
- "fmt"
"internal/testenv"
"io"
"os"
t.Fatalf("error on failed import does not mention GOROOT/src/vendor directory:\n%s", e)
}
}
-
-// Issue 3248
-func TestBogusDirectory(t *testing.T) {
- const dir = "/foo/bar/baz/gopher"
- _, err := ImportDir(dir, FindOnly)
- want := fmt.Sprintf("%q is not a directory", filepath.FromSlash(dir))
- if err == nil || err.Error() != want {
- t.Errorf("got error %q, want %q", err, want)
- }
-}