diff options
author | Russ Cox <rsc@golang.org> | 2020-06-29 10:38:06 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2020-10-12 18:31:02 +0000 |
commit | 8b289a15e45328c9953a7c5c4ce1409c4297dee1 (patch) | |
tree | 5de3e8823db7d4aafe962fdffa132b073b297c65 /src/cmd/go/internal/load/pkg.go | |
parent | 5acec489a1987bd2f3d342f63d02e08d546f0fc3 (diff) | |
download | go-8b289a15e45328c9953a7c5c4ce1409c4297dee1.tar.gz go-8b289a15e45328c9953a7c5c4ce1409c4297dee1.zip |
cmd/go: remove Package.constraintIgnoredGoFiles
Now all of IgnoredGoFiles is constraint-ignored Go files.
Change-Id: I03001796c290708ab835526250c619dd667a8607
Reviewed-on: https://go-review.googlesource.com/c/go/+/240552
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/load/pkg.go')
-rw-r--r-- | src/cmd/go/internal/load/pkg.go | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 5cc77915e7..ffa083f2f0 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -185,7 +185,7 @@ type NoGoError struct { } func (e *NoGoError) Error() string { - if len(e.Package.constraintIgnoredGoFiles()) > 0 { + if len(e.Package.IgnoredGoFiles) > 0 { // Go files exist, but they were ignored due to build constraints. return "build constraints exclude all Go files in " + e.Package.Dir } @@ -2009,22 +2009,7 @@ func (p *Package) InternalXGoFiles() []string { // using absolute paths. "Possibly relevant" means that files are not excluded // due to build tags, but files with names beginning with . or _ are still excluded. func (p *Package) InternalAllGoFiles() []string { - return p.mkAbs(str.StringList(p.constraintIgnoredGoFiles(), p.GoFiles, p.CgoFiles, p.TestGoFiles, p.XTestGoFiles)) -} - -// constraintIgnoredGoFiles returns the list of Go files ignored for reasons -// other than having a name beginning with '.' or '_'. -func (p *Package) constraintIgnoredGoFiles() []string { - if len(p.IgnoredGoFiles) == 0 { - return nil - } - files := make([]string, 0, len(p.IgnoredGoFiles)) - for _, f := range p.IgnoredGoFiles { - if f != "" && f[0] != '.' && f[0] != '_' { - files = append(files, f) - } - } - return files + return p.mkAbs(str.StringList(p.IgnoredGoFiles, p.GoFiles, p.CgoFiles, p.TestGoFiles, p.XTestGoFiles)) } // usesSwig reports whether the package needs to run SWIG. |