]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "cmd/go: note when some Go files were ignored on no-Go-files errors"
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 21 Dec 2016 03:24:08 +0000 (03:24 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 21 Dec 2016 05:25:57 +0000 (05:25 +0000)
This reverts commit eee727d0855b9e78f9df87e08d57b1d7f264876c
(https://golang.org/cl/29113)

The " (.go files ignored due to build tags)" error message is not
always accurate.

Fixes #18396
Updates #17008

Change-Id: I609653120603a7f6094bc1dc3a83856f4b259241
Reviewed-on: https://go-review.googlesource.com/34662
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
api/go1.8.txt
src/go/build/build.go
src/go/build/build_test.go
src/go/build/testdata/ignored/ignored.go [deleted file]

index 5e21b07d03bb70f028c895a850eafbea001842af..fca7e03c9f999b37bb14926ea93080fdb729b4b7 100644 (file)
@@ -176,7 +176,6 @@ pkg expvar, method (*Float) Value() float64
 pkg expvar, method (Func) Value() interface{}
 pkg expvar, method (*Int) Value() int64
 pkg expvar, method (*String) Value() string
-pkg go/build, type NoGoError struct, Ignored bool
 pkg go/doc, func IsPredeclared(string) bool
 pkg go/types, func Default(Type) Type
 pkg go/types, func IdenticalIgnoreTags(Type, Type) bool
index ea37bbbcb503c3b3e2d6ea111c5d2783a35a454d..da12d50bb15baae5d8e980b6ee2b1cea38413b74 100644 (file)
@@ -439,16 +439,11 @@ func (ctxt *Context) ImportDir(dir string, mode ImportMode) (*Package, error) {
 // containing no buildable Go source files. (It may still contain
 // test files, files hidden by build tags, and so on.)
 type NoGoError struct {
-       Dir     string
-       Ignored bool // whether any Go files were ignored due to build tags
+       Dir string
 }
 
 func (e *NoGoError) Error() string {
-       msg := "no buildable Go source files in " + e.Dir
-       if e.Ignored {
-               msg += " (.go files ignored due to build tags)"
-       }
-       return msg
+       return "no buildable Go source files in " + e.Dir
 }
 
 // MultiplePackageError describes a directory containing
@@ -880,7 +875,7 @@ Found:
                return p, badGoError
        }
        if len(p.GoFiles)+len(p.CgoFiles)+len(p.TestGoFiles)+len(p.XTestGoFiles) == 0 {
-               return p, &NoGoError{Dir: p.Dir, Ignored: len(p.IgnoredGoFiles) > 0}
+               return p, &NoGoError{p.Dir}
        }
 
        for tag := range allTags {
index 8ca8e5e04d41565f8df28cc173db4612f8a6c7a8..a9972416ef2feb264121704b38e43e5c349d8136 100644 (file)
@@ -93,17 +93,6 @@ func TestEmptyFolderImport(t *testing.T) {
        }
 }
 
-func TestIgnoredGoFilesImport(t *testing.T) {
-       _, err := Import(".", "testdata/ignored", 0)
-       e, ok := err.(*NoGoError)
-       if !ok {
-               t.Fatal(`Import("testdata/ignored") did not return NoGoError.`)
-       }
-       if !e.Ignored {
-               t.Fatal(`Import("testdata/ignored") should have ignored Go files.`)
-       }
-}
-
 func TestMultiplePackageImport(t *testing.T) {
        _, err := Import(".", "testdata/multi", 0)
        mpe, ok := err.(*MultiplePackageError)
diff --git a/src/go/build/testdata/ignored/ignored.go b/src/go/build/testdata/ignored/ignored.go
deleted file mode 100644 (file)
index 48a2ae8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-// +build alwaysignore
-
-package ignored