]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add positions for load errors in call to load
authorMichael Matloob <matloob@golang.org>
Fri, 17 Apr 2020 17:01:38 +0000 (13:01 -0400)
committerMichael Matloob <matloob@golang.org>
Wed, 6 May 2020 19:03:06 +0000 (19:03 +0000)
commit641918ee09cb44d282a30ee8b66f99a0b63eaef9
tree074d235783922ba1d2a714461e9e2de2aff16152
parente538b7e931c209706c3e8c1b0c2d53dab651b965
cmd/go: add positions for load errors in call to load

This CL sets positions for errors from cals to load within the load
call itself, similar to how the rest of the code in pkg.go sets
positions right after the error is set on the package.

This allows the code to ensure that we only add positions either for
ImportPathErrors, or if an error was passed into load, and was set
using setLoadPackageDataError. (Though I'm wondering if the call
to setLoadPackageDataError should be done before the call to load).

Fixes #38034

Change-Id: I0748866933b4c1a329954b4b96640bef702a4644
Reviewed-on: https://go-review.googlesource.com/c/go/+/228784
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/test.go
src/cmd/go/internal/modload/load.go
src/cmd/go/testdata/script/list_case_collision.txt