pulumi/pkg/engine/pack_verify.go
Matt Ellis 865422567c Alow multiple instances of engine.Engine
This refactors the engine so all of the APIs on it are instance
methods on the type instead of raw methods that float around and use
data from a global engine.

A mechcanical change as we remove the global `E` and then make
anything that interacted with that in pkg/engine to be an instance
method and the dealing with the fallout.
2017-08-24 18:09:37 -07:00

19 lines
565 B
Go

package engine
import "github.com/pkg/errors"
func (eng *Engine) PackVerify(pkgarg string) error {
// Prepare the compiler info and, provided it succeeds, perform the verification.
if comp, pkg := eng.prepareCompiler(pkgarg); comp != nil {
// Now perform the compilation and extract the heap snapshot.
if pkg == nil && !comp.Verify() {
return errors.New("verification failed")
} else if pkg != nil && !comp.VerifyPackage(pkg) {
return errors.New("verification failed")
}
return nil
}
return errors.New("could not create prepare compiler")
}