aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/modload/import.go
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2020-08-18 10:54:11 -0400
committerDmitri Shuralyov <dmitshur@golang.org>2020-08-18 15:45:01 +0000
commitc12d9ed87596688aeeeb61111e408f6a176aa287 (patch)
tree38501e2cde85ed04ad5af741c0ad524264e7611b /src/cmd/go/internal/modload/import.go
parent6e876f19857a8fbd259571080f7f91bc03276559 (diff)
downloadgo-c12d9ed87596688aeeeb61111e408f6a176aa287.tar.gz
go-c12d9ed87596688aeeeb61111e408f6a176aa287.zip
cmd/go: revert 3 CLs affecting par.Work, context propagation, tracing
This reverts the following changes: • cmd/go: add tracing for querying and downloading from the proxy CL 242786, commit 1a3558341860357c2400e37773e5076bb3a51628 • cmd/go: do context propagation for tracing downloads CL 248327, commit c0cf190d226cc3defb71d17c01d0b45bf49a8a85 • cmd/go/internal: remove some users of par.Work CL 248326, commit f30044a03bc7cf107dbec03c02fb6d0072878252 Reason for revert: broke linux 386 and amd64 longtest builders. The problem started with CL 248326, but CL 248327 and CL 242786 are reverted as well due to conflicts. Updates #38714. Fixes #40861. Change-Id: I68496b4e5a27e47a42183553c3a645b288edac83 Reviewed-on: https://go-review.googlesource.com/c/go/+/249017 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/go/internal/modload/import.go')
-rw-r--r--src/cmd/go/internal/modload/import.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go
index 5c51a79124..4d2bc805e2 100644
--- a/src/cmd/go/internal/modload/import.go
+++ b/src/cmd/go/internal/modload/import.go
@@ -5,7 +5,6 @@
package modload
import (
- "context"
"errors"
"fmt"
"go/build"
@@ -111,7 +110,7 @@ var _ load.ImportPathError = &AmbiguousImportError{}
// Import returns an ImportMissingError as the error.
// If Import can identify a module that could be added to supply the package,
// the ImportMissingError records that module.
-func Import(ctx context.Context, path string) (m module.Version, dir string, err error) {
+func Import(path string) (m module.Version, dir string, err error) {
if strings.Contains(path, "@") {
return module.Version{}, "", fmt.Errorf("import path should not have @version")
}
@@ -166,7 +165,7 @@ func Import(ctx context.Context, path string) (m module.Version, dir string, err
// Avoid possibly downloading irrelevant modules.
continue
}
- root, isLocal, err := fetch(ctx, m)
+ root, isLocal, err := fetch(m)
if err != nil {
// Report fetch error.
// Note that we don't know for sure this module is necessary,
@@ -249,7 +248,7 @@ func Import(ctx context.Context, path string) (m module.Version, dir string, err
return len(mods[i].Path) > len(mods[j].Path)
})
for _, m := range mods {
- root, isLocal, err := fetch(ctx, m)
+ root, isLocal, err := fetch(m)
if err != nil {
// Report fetch error as above.
return module.Version{}, "", err
@@ -286,7 +285,7 @@ func Import(ctx context.Context, path string) (m module.Version, dir string, err
fmt.Fprintf(os.Stderr, "go: finding module for package %s\n", path)
- candidates, err := QueryPackage(ctx, path, "latest", Allowed)
+ candidates, err := QueryPackage(path, "latest", Allowed)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
// Return "cannot find module providing package […]" instead of whatever