aboutsummaryrefslogtreecommitdiff
path: root/src/go/build/build.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/build/build.go')
-rw-r--r--src/go/build/build.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/go/build/build.go b/src/go/build/build.go
index f6aabcb3af..da12d50bb1 100644
--- a/src/go/build/build.go
+++ b/src/go/build/build.go
@@ -76,8 +76,9 @@ type Context struct {
// If IsDir is nil, Import calls os.Stat and uses the result's IsDir method.
IsDir func(path string) bool
- // HasSubdir reports whether dir is a subdirectory of
- // (perhaps multiple levels below) root.
+ // HasSubdir reports whether dir is lexically a subdirectory of
+ // root, perhaps multiple levels below. It does not try to check
+ // whether dir exists.
// If so, HasSubdir sets rel to a slash-separated path that
// can be joined to root to produce a path equivalent to dir.
// If HasSubdir is nil, Import uses an implementation built on
@@ -438,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
@@ -879,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 {