func (p *Package) Check() error {
	if p.Pkg != nil {
		return nil
	}

	var typeErrors []error
	checker := p.TypeChecker
	checker.Error = func(err error) {
		typeErrors = append(typeErrors, err)
	}

	// Do typechecking of the package.
	checker.Importer = p

	typesPkg, err := checker.Check(p.ImportPath, p.fset, p.Files, &p.Info)
	if err != nil {
		if err, ok := err.(Errors); ok {
			return err
		}
		return Errors{p, typeErrors}
	}
	p.Pkg = typesPkg
	return nil
}
// Check runs the package through the typechecker. The package must already be
// loaded and all dependencies must have been checked already.
//
// Idempotent.
Check runs the package through the typechecker. The package must already be
loaded and all dependencies must have been checked already.

Idempotent.
// Check runs the package through the typechecker . The package must already be // loaded and all dependencies must have been checked already . // // Idempotent .
func (p *Package) Check() error {
	if p.Pkg != nil {
		return nil
	}
	var typeErrors []error
	checker := p.TypeChecker
	checker.Error = func(err error) {
		typeErrors = append(typeErrors, err)
	}
	checker.Importer = p
	typesPkg, err := checker.Check(p.ImportPath, p.fset, p.Files, &p.Info)
	if err != nil {
		if err, ok := err.(Errors); ok {
			return err
		}
		return Errors{p, typeErrors}
	}
	p.Pkg = typesPkg
	return nil
}
func ( p * Package ) Check ( ) error { if p . Pkg != nil { return nil } var typeErrors [ ] error checker := p . TypeChecker checker . Error = func ( err error ) { typeErrors = append ( typeErrors , err ) } checker . Importer = p typesPkg , err := checker . Check ( p . ImportPath , p . fset , p . Files , & p . Info ) if err != nil { if err , ok := err . ( Errors ) ; ok { return err } return Errors { p , typeErrors } } p . Pkg = typesPkg return nil }
Check runs the package through the typechecker.
Check runs the package through the typechecker .
// Do typechecking of the package.