func NewImporter() *Importer {
	return &Importer{
		cache:           make(map[string]*types.Package),
		defaultImporter: importer.Default(),
	}
}
NewImporter creates a new Importer instance with the default importer of
the runtime assigned as the underlying importer.
package parseutil
import (
	"fmt"
	"go/ast"
	"go/build"
	"go/importer"
	"go/parser"
	"go/token"
	"go/types"
	"os"
	"path/filepath"
	"strings"
	"sync"
)
var ErrNotInGoPath = fmt.Errorf("parseutil: package is not in any of the go paths")
type GoPath []string
func (gp GoPath) Abs(pkg string) (string, error) {
	path, err := gp.PathOf(pkg)
	if err != nil {
		return "", err
	}
	return filepath.Join(path, "src", pkg), nil
}
func (gp GoPath) PathOf(pkg string) (string, error) {
	for _, p := range gp {
		if _, err := os.Stat(filepath.Join(p, "src", pkg)); err == nil {
			return p, nil
		} else if !os.IsNotExist(err) {
			return "", err
		}
	}
	return "", ErrNotInGoPath
}
var DefaultGoPath = GoPath(filepath.SplitList(build.Default.GOPATH))
type FileFilter func(pkgPath, file string, typ FileType) bool
type FileFilters []FileFilter
func (fs FileFilters) KeepFile(pkgPath, file string, typ FileType) bool {
	for _, f := range fs {
		if !f(pkgPath, file, typ) {
			return false
		}
	}
	return true
}
func (fs FileFilters) Filter(pkgPath string, files []string, typ FileType) (filtered []string) {
	for _, f := range files {
		if fs.KeepFile(pkgPath, f, typ) {
			filtered = append(filtered, f)
		}
	}
	return
}
type FileType string
const (
	GoFile  FileType = "go"
	CgoFile FileType = "cgo"
)
type Importer struct {
	mut   sync.RWMutex
	cache map[string]*types.Package
	defaultImporter types.Importer
}