]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: ignore import of "C" when fetching dependencies
authorIan Lance Taylor <iant@golang.org>
Thu, 16 Jul 2015 23:25:44 +0000 (16:25 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 17 Jul 2015 22:58:39 +0000 (22:58 +0000)
The change https://golang.org/cl/12192 changed the get code to use the
list of package imports, not the computed list of dependencies, as the
computed list could be out of date if the package changed when using
go get -u.  Computing the dependency list would skip an import of "C",
but that would still be on the package import list.  This changes the
code to skip "C" when walking the import list.

No test--the best test would be to add an import of "C" to
github.com/rsc/go-get-issue-9224-cmd for TestGoGetUpdate.

Fixes #11738.

Change-Id: Id89ddafeade2391d15688bfd142fafd67844a941
Reviewed-on: https://go-review.googlesource.com/12322
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/cmd/go/get.go

index 09314f563e6f824ed966d6f3782bd98bd5da7a6d..320698ec476bf8ca6604b3d3771a83afb59ba6c7 100644 (file)
@@ -278,6 +278,9 @@ func download(arg string, parent *Package, stk *importStack, getTestDeps bool) {
 
                // Process dependencies, now that we know what they are.
                for _, path := range p.Imports {
+                       if path == "C" {
+                               continue
+                       }
                        // Don't get test dependencies recursively.
                        download(path, p, stk, false)
                }