1
0
mirror of https://github.com/golang/go synced 2024-11-18 22:04:43 -07:00
go/internal/imports
Suzy Mueller 4147ede4f8 internal/imports: fix setting default options
This fixes a nil pointer bug that occurs when opt is nil.

If nil is provide as opt to the internal/imports package, use the
default options settings.

Also check separately that Env is non-nil, as this would also cause
a crash.

Change-Id: I9a43b219b31ba80b7cb8111437f211cb72f1ca18
Reviewed-on: https://go-review.googlesource.com/c/tools/+/189939
Reviewed-by: Heschi Kreinick <heschi@google.com>
2019-08-12 19:12:14 +00:00
..
testdata/mod imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
fix_test.go x/tools/internal/imports: don't load package names for empty list 2019-07-31 21:28:42 +00:00
fix.go internal/imports, internal/lsp: quick fix import errors 2019-08-01 20:53:47 +00:00
imports.go internal/imports: fix setting default options 2019-08-12 19:12:14 +00:00
mkindex.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
mkstdlib.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
mod_112_test.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
mod_test.go internal/imports: save scanned module cache results 2019-07-18 20:03:17 +00:00
mod.go internal/imports: save scanned module cache results 2019-07-18 20:03:17 +00:00
proxy_112_test.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
proxy_113_test.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
sortimports.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00
zstdlib.go imports: rename to internal/imports 2019-05-20 21:49:35 +00:00