Skip to content

Commit

Permalink
Move to the default importer from gcexportdata (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgechev committed Aug 6, 2022
1 parent db56db0 commit 71ef7fd
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lint/package.go
Expand Up @@ -2,12 +2,11 @@ package lint

import (
"go/ast"
"go/importer"
"go/token"
"go/types"
"sync"

"golang.org/x/tools/go/gcexportdata"

"github.com/mgechev/revive/internal/typeparams"
)

Expand All @@ -26,10 +25,6 @@ type Package struct {
sync.RWMutex
}

var newImporter = func(fset *token.FileSet) types.ImporterFrom {
return gcexportdata.NewImporter(fset, make(map[string]*types.Package))
}

var (
trueValue = 1
falseValue = 2
Expand Down Expand Up @@ -95,7 +90,7 @@ func (p *Package) TypeCheck() error {
config := &types.Config{
// By setting a no-op error reporter, the type checker does as much work as possible.
Error: func(error) {},
Importer: newImporter(p.fset),
Importer: importer.Default(),
}
info := &types.Info{
Types: make(map[ast.Expr]types.TypeAndValue),
Expand Down

0 comments on commit 71ef7fd

Please sign in to comment.