From: Jay Conrod Date: Fri, 18 Sep 2020 12:33:44 +0000 (-0400) Subject: cmd/go: fix review comments in load, modload X-Git-Tag: go1.16beta1~998 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bf9800c7931da96e2ddc8363955f43581265b95c;p=gostls13.git cmd/go: fix review comments in load, modload Follow-up to CL 255719, fixing review comments. Change-Id: I26d3cc622496c3902c6924cf2b746c50705c4d50 Reviewed-on: https://go-review.googlesource.com/c/go/+/255937 Trust: Jay Conrod Run-TryBot: Jay Conrod TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills --- diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index d06e65737d..077fdf25d3 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -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{} diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index 2c95fa4263..7a62436e35 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -209,7 +209,6 @@ func Init() { } cfg.ModulesEnabled = true - // load.ModDirImportPath = DirImportPath if modRoot == "" { // We're in module mode, but not inside a module.