1
0
mirror of https://github.com/golang/go synced 2024-11-23 09:30:03 -07:00

go/types: use new importer.ForCompiler for gotype command

This will produce better error messages (position information)
for errors referring to imported objects.

Change-Id: I24646ae803e6b8f78e9240310a858d4095e9463d
Reviewed-on: https://go-review.googlesource.com/c/152538
Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
Robert Griesemer 2018-12-04 10:17:33 -08:00
parent 159797a5fc
commit 7114e9997b

View File

@ -297,7 +297,7 @@ func checkPkgFiles(files []*ast.File) {
}
report(err)
},
Importer: importer.For(*compiler, nil),
Importer: importer.ForCompiler(fset, *compiler, nil),
Sizes: types.SizesFor(build.Default.Compiler, build.Default.GOARCH),
}