From 97572d5552699fbc7cce215f83d7b02265e7f1de Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 8 Feb 2016 22:50:17 -0500 Subject: [PATCH] cmd/go: silence standard imports non-standard error for non-existent import target 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 Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/go/pkg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go index a804ccd277..0c0cf07e71 100644 --- a/src/cmd/go/pkg.go +++ b/src/cmd/go/pkg.go @@ -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), -- 2.48.1