pulumi/pkg/util/contract/failfast.go
joeduffy 23045c5792 Simply panic for failfast
The old contract library tried to be glog-friendly in its failfast behavior.
It turns out glog seldom does the right thing when goroutines are involved
(which, as of last sprint, they now are).  We already had issues with stacks
not getting printed when --logtostderr was turned on, and the code tried
to work around this; but this still didn't work for the goroutines case.

All of this seems like way too much cleverness.  Let's just use Go panics.
2017-06-27 11:12:06 -07:00

12 lines
252 B
Go

// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
package contract
import (
"fmt"
)
// failfast logs and panics the process in a way that is friendly to debugging.
func failfast(msg string) {
panic(fmt.Sprintf("fatal: %v", msg))
}