19 lines
434 B
Go
19 lines
434 B
Go
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
|
|
|
|
package contract
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
const failMsg = "A failure has occurred"
|
|
|
|
// Fail unconditionally abandons the process.
|
|
func Fail() {
|
|
failfast(failMsg)
|
|
}
|
|
|
|
// Failf unconditionally abandons the process, formatting and logging the given message.
|
|
func Failf(msg string, args ...interface{}) {
|
|
failfast(fmt.Sprintf("%v: %v", failMsg, fmt.Sprintf(msg, args...)))
|
|
}
|