]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/load: make check for path in import error more robust
authorMichael Matloob <matloob@golang.org>
Tue, 6 Aug 2024 16:42:34 +0000 (12:42 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 6 Aug 2024 20:20:34 +0000 (20:20 +0000)
commit44ed517c42a52e0c5831383b59eae5b38428656d
tree762c13aa188a4c6f040e25f54e100ae61e401d38
parentb62342216d632d972f1438b4f542f89c4b4a331d
cmd/go/internal/load: make check for path in import error more robust

When producing an ImportPathError from ImportErrorf, we check to see
whether the error string contains the path for the error. The issue is
that we were checking for the exact path string when sometimes the
string is quoted when the error is constructed, and the escaping in the
quote may not match the path string. Check for both the path string, and
the quoted path string.

Fixes #68737

Change-Id: I01bf4e495056e929570bc11bc1f2000ce6d2802b
Reviewed-on: https://go-review.googlesource.com/c/go/+/603475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/testdata/script/list_panic_issue68737.txt [new file with mode: 0644]