func (t *Type) loadStruct(importPath string) error {
	structName := t.Name
	if importPath == "" {
		importPath = "./"
	}
	p, err := Program(importPath)
	if err != nil {
		return fmt.Errorf("load program: %s", err)
	}
	for _, pkg := range p.Imported {
		for _, scope := range pkg.Scopes {
			st := lookup(scope.Parent(), structName)
			if st != nil {
				t.st = st
				t.pkg = pkg.Pkg
				return nil
			}
		}
	}
	return ErrTypeNotFound
}
loadStruct loads struct information from go package
package load
import (
	"errors"
	"fmt"
	"go/importer"
	"go/types"
	"sync"
	"golang.org/x/tools/go/loader"
)
var (
	ErrTypeNotFound = errors.New("type was not found")
	loadConfig = loader.Config{
		AllowErrors:         true,
		TypeCheckFuncBodies: func(_ string) bool { return false },
		TypeChecker: types.Config{
			DisableUnusedImportCheck: true,
			Importer:                 importer.Default(),
		},
	}
	importCache = map[string]*loader.Program{}
	cacheLock   sync.Mutex
)
func Program(importPath string) (*loader.Program, error) {
	cacheLock.Lock()
	defer cacheLock.Unlock()
	if p := importCache[importPath]; p != nil {
		return p, nil
	}
	loadConfig.Import(importPath)
	p, err := loadConfig.Load()
	if err != nil {
		return nil, err
	}
	importCache[importPath] = p
	return p, err
}