forked from mirror/enumer
fixed importer
This commit is contained in:
parent
3d7dacca3a
commit
8bdc3a85b5
|
@ -64,7 +64,9 @@ import (
|
|||
"fmt"
|
||||
"go/ast"
|
||||
"go/build"
|
||||
exact "go/constant"
|
||||
"go/format"
|
||||
"go/importer"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"go/types"
|
||||
|
@ -74,10 +76,6 @@ import (
|
|||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
exact "go/constant"
|
||||
|
||||
_ "go/importer"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -270,7 +268,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{FakeImportC: true}
|
||||
config := types.Config{Importer: importer.Default(), FakeImportC: true}
|
||||
info := &types.Info{
|
||||
Defs: pkg.defs,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue