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.
12 lines
252 B
Go
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))
|
|
}
|