]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: change the wording of NoGoError and comment it better
authorRob Pike <r@golang.org>
Tue, 13 Aug 2013 01:32:32 +0000 (11:32 +1000)
committerRob Pike <r@golang.org>
Tue, 13 Aug 2013 01:32:32 +0000 (11:32 +1000)
Out of context, it can be very confusing because there can be lots of Go
files in the directory, but the error message says there aren't.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/12823043

src/pkg/go/build/build.go

index 563e7fe21b8a9ce49aafb5756425e9aba7ee6ca9..ecea22456e25694a43e53dded934bcd434eafcba 100644 (file)
@@ -395,13 +395,14 @@ func (ctxt *Context) ImportDir(dir string, mode ImportMode) (*Package, error) {
 }
 
 // NoGoError is the error used by Import to describe a directory
-// containing no Go source files.
+// 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
 }
 
 func (e *NoGoError) Error() string {
-       return "no Go source files in " + e.Dir
+       return "no buildable Go source files in " + e.Dir
 }
 
 // Import returns details about the Go package named by the import path,