import from source

This commit is contained in:
Carl Sverre 2017-11-28 15:31:38 -08:00
parent fbb114e61f
commit 7f992c627d
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ func (g *Generator) parsePackage(directory string, names []string, text interfac
// check type-checks the package. The package must be OK to proceed.
func (pkg *Package) check(fs *token.FileSet, astFiles []*ast.File) {
pkg.defs = make(map[*ast.Ident]types.Object)
config := types.Config{Importer: importer.Default(), FakeImportC: true}
config := types.Config{Importer: importer.For("source", nil), FakeImportC: true}
info := &types.Info{
Defs: pkg.defs,
}