aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2018-08-17 10:54:20 -0400
committerRuss Cox <rsc@golang.org>2018-08-17 14:56:26 +0000
commit751ea9369a9bd3b30daafced4d1c172541076617 (patch)
tree6fcc49afb209faf0daf02a8aef70a2cef61817d8
parent974d5364a643e107c4dea1df20293c67c32bfc04 (diff)
downloadgo-751ea9369a9bd3b30daafced4d1c172541076617.tar.gz
go-751ea9369a9bd3b30daafced4d1c172541076617.zip
cmd/go: document import "C" check from CL 129062
Added this locally but then broke the first rule of Gerrit and clicked Submit instead of running "git submit". Change-Id: I83c28d9151c566e9b2092e2613d67731a5d64beb Reviewed-on: https://go-review.googlesource.com/129678 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r--src/cmd/go/internal/imports/scan.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/go/internal/imports/scan.go b/src/cmd/go/internal/imports/scan.go
index bae6b934bc..d944e95724 100644
--- a/src/cmd/go/internal/imports/scan.go
+++ b/src/cmd/go/internal/imports/scan.go
@@ -49,12 +49,19 @@ Files:
if err != nil {
return nil, nil, fmt.Errorf("reading %s: %v", name, err)
}
- // import "C" is implicit requirement of cgo tag
+
+ // import "C" is implicit requirement of cgo tag.
+ // When listing files on the command line (explicitFiles=true)
+ // we do not apply build tag filtering but we still do apply
+ // cgo filtering, so no explicitFiles check here.
+ // Why? Because we always have, and it's not worth breaking
+ // that behavior now.
for _, path := range list {
if path == `"C"` && !tags["cgo"] && !tags["*"] {
continue Files
}
}
+
if !explicitFiles && !ShouldBuild(data, tags) {
continue
}