]> Cypherpunks repositories - gostls13.git/commit
cmd/go: don't construct module version info if there are import errors
authorJay Conrod <jayconrod@google.com>
Thu, 19 Sep 2019 16:58:02 +0000 (12:58 -0400)
committerJay Conrod <jayconrod@google.com>
Thu, 19 Sep 2019 20:53:11 +0000 (20:53 +0000)
commite2cbb7f629d05807925a5dcd08b61b2a30306ac5
tree691ba237339b32a28ed6a6e97bc71f5f7a3f92a1
parent1c50fcf853b0382ac6a98e4c84eb90230b37832f
cmd/go: don't construct module version info if there are import errors

A precondition of modload.PackageBuildInfo is that its path and deps
arguments correspond to paths that have been loaded successfully with
modload.ImportPaths or one of the Load functions. load.Package.load
should not call PackageBuildInfo if there were any errors resolving
imports.

Fixes #34393

Change-Id: I107514f1c535885330ff266c85d3981b71b31c2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/196520
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modload/build.go
src/cmd/go/testdata/script/mod_build_info_err.txt [new file with mode: 0644]