]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: clean up after rollback
authorAndrew Gerrand <adg@golang.org>
Tue, 29 Jan 2013 22:10:58 +0000 (09:10 +1100)
committerAndrew Gerrand <adg@golang.org>
Tue, 29 Jan 2013 22:10:58 +0000 (09:10 +1100)
R=rsc
CC=golang-dev
https://golang.org/cl/7237049

src/pkg/go/build/build.go
src/pkg/go/build/build_test.go

index f11582ac685584b4bdeccaaf047670b98b3737c8..e2a47a556a70bc14cec8c93f2334a449a78a91f5 100644 (file)
@@ -321,13 +321,7 @@ func (p *Package) IsCommand() bool {
 // 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)
-       // 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
+       return ctxt.Import(".", dir, mode)
 }
 
 // NoGoError is the error used by Import to describe a directory
index 4684d9baf804eb0d45312389f01aee218e48d588..d8cf98840d71f33ec435ce2f3cf2d13699661294 100644 (file)
@@ -5,7 +5,6 @@
 package build
 
 import (
-       "fmt"
        "os"
        "path/filepath"
        "runtime"
@@ -90,17 +89,6 @@ 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))
-       if err == nil || err.Error() != want {
-               t.Errorf("got error %q, want %q", err, want)
-       }
-}
-
 func TestShouldBuild(t *testing.T) {
        const file1 = "// +build tag1\n\n" +
                "package main\n"