]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: silence standard imports non-standard error for non-existent import target
authorRuss Cox <rsc@golang.org>
Tue, 9 Feb 2016 03:50:17 +0000 (22:50 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 9 Feb 2016 20:36:06 +0000 (20:36 +0000)
This error only affects the compilation of the standard library,
but I discovered that if you import "notexist" from the standard
library then you get both an error about notexist not existing
and an error about notexist being a non-standard package
(because the non-existant package is in fact not a standard package).
Silence the second error.

Change-Id: Ib4c1523e89844260fde90de3459ec1e752df8f25
Reviewed-on: https://go-review.googlesource.com/19383
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/pkg.go

index a804ccd277cfdff699efff776e337543f5f8678c..0c0cf07e71f5c9c28a1f6c0851a54490cd19e126 100644 (file)
@@ -967,7 +967,7 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package
                                }
                        }
                }
-               if p.Standard && !p1.Standard && p.Error == nil {
+               if p.Standard && p.Error == nil && !p1.Standard && p1.Error == nil {
                        p.Error = &PackageError{
                                ImportStack: stk.copy(),
                                Err:         fmt.Sprintf("non-standard import %q in standard package %q", path, p.ImportPath),