1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00
go/cmd/goimports
Annirudh Prasad 7480c7b454 goimport: prevent panic on parsing local prefix
The existing flag parsing logic doesn't initialize a ProcessEnv struct,
which results in a nil dereference when trying to access the LocalPrefix
property. The fix is to initialize the default options with an initialized
ProcessEnv.

Fixes #39862

Change-Id: I57cff249d6bf0ced6bb70e53174b2515fe9fbb97
GitHub-Last-Rev: 2d6e5f3af226088ddc4ed88198edd5c5ea469240
GitHub-Pull-Request: golang/tools#239
Reviewed-on: https://go-review.googlesource.com/c/tools/+/240019
Reviewed-by: Heschi Kreinick <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
2020-06-25 19:53:45 +00:00
..
doc.go cmd/goimports: update Emacs install instructions 2018-11-30 05:20:23 +00:00
goimports_gc.go cmd/goimports: work around lack of runtime/trace in gccgo 2016-08-13 05:07:58 +00:00
goimports_not_gc.go cmd/goimports: work around lack of runtime/trace in gccgo 2016-08-13 05:07:58 +00:00
goimports.go goimport: prevent panic on parsing local prefix 2020-06-25 19:53:45 +00:00