The code & documentation disagree about whether go/build.NoGoError includes tests.
Code says:
if len(p.GoFiles)+len(p.CgoFiles)+len(p.TestGoFiles)+len(p.XTestGoFiles) == 0 {
return p, &NoGoError{p.Dir}
}
But docs say:
// NoGoError is the error used by Import to describe a directory
// 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
}
(Notably, the "it may still contain test files" part, implying that a directory with only foo_test.go should be NoGoError).
/cc @bcmills @jayconrod @rsc @ianlancetaylor
The code & documentation disagree about whether
go/build.NoGoErrorincludes tests.Code says:
But docs say:
(Notably, the "it may still contain test files" part, implying that a directory with only
foo_test.goshould be NoGoError)./cc @bcmills @jayconrod @rsc @ianlancetaylor