зеркало из https://github.com/golang/tools.git
7cc3be7d11
The directories processed by gopathwalk are clean, yet in the scan callback are assumed to have the root as a prefix. For the module cache, this root was previous not guaranteed to be clean, if it came from a GOMODCACHE environment variable. As a result, the computed relative path may be inaccurate, and may even panic if the unclean root is much longer than its clean form. Reproduce the crash of golang/go#67156 in a test, update scanDirForPackage to be more robust, and fix the uncleanliness of the module cache root. Also fix some handling of GOMODCACHE cleanup in imports tests. Fixes golang/go#67156 Change-Id: Ia899256fed9629b7e753a52feb02b4235bfc8388 Reviewed-on: https://go-review.googlesource.com/c/tools/+/603635 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> |
||
---|---|---|
.. | ||
testdata/mod | ||
fix.go | ||
fix_test.go | ||
imports.go | ||
imports_test.go | ||
mkindex.go | ||
mod.go | ||
mod_cache.go | ||
mod_cache_test.go | ||
mod_go122_test.go | ||
mod_test.go | ||
sortimports.go |