mirror of https://github.com/golang/go.git
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 <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
6a208efbdf
commit
97572d5552
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue