]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix review comments in load, modload
authorJay Conrod <jayconrod@google.com>
Fri, 18 Sep 2020 12:33:44 +0000 (08:33 -0400)
committerJay Conrod <jayconrod@google.com>
Fri, 18 Sep 2020 13:37:22 +0000 (13:37 +0000)
Follow-up to CL 255719, fixing review comments.

Change-Id: I26d3cc622496c3902c6924cf2b746c50705c4d50
Reviewed-on: https://go-review.googlesource.com/c/go/+/255937
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modload/init.go

index d06e65737d4a0426621aa305912e8186c6410220..077fdf25d356b525d8c73a3f04da438e758bf3d5 100644 (file)
@@ -420,13 +420,16 @@ type ImportPathError interface {
        ImportPath() string
 }
 
+var (
+       _ ImportPathError = (*importError)(nil)
+       _ ImportPathError = (*modload.ImportMissingError)(nil)
+)
+
 type importError struct {
        importPath string
        err        error // created with fmt.Errorf
 }
 
-var _ ImportPathError = (*importError)(nil)
-
 func ImportErrorf(path, format string, args ...interface{}) ImportPathError {
        err := &importError{importPath: path, err: fmt.Errorf(format, args...)}
        if errStr := err.Error(); !strings.Contains(errStr, path) {
@@ -882,7 +885,7 @@ var preloadWorkerCount = runtime.GOMAXPROCS(0)
 // because of global mutable state that cannot safely be read and written
 // concurrently. In particular, packageDataCache may be cleared by "go get"
 // in GOPATH mode, and modload.loaded (accessed via modload.Lookup) may be
-// modified by modload.ImportPaths (modload.ImportPaths).
+// modified by modload.ImportPaths.
 type preload struct {
        cancel chan struct{}
        sema   chan struct{}
index 2c95fa4263bf9e1e53f68d200d1ee576b326c8ef..7a62436e3514ee7c34286c70e90cede28e3af064 100644 (file)
@@ -209,7 +209,6 @@ func Init() {
        }
 
        cfg.ModulesEnabled = true
-       // load.ModDirImportPath = DirImportPath
 
        if modRoot == "" {
                // We're in module mode, but not inside a module.