This is the first change of many to merge the MuPack/MuIL formats into the heart of the "compiler". In fact, the entire meaning of the compiler has changed, from something that took metadata and produced CloudFormation, into something that takes MuPack/MuIL as input, and produces a MuGL graph as output. Although this process is distinctly different, there are several aspects we can reuse, like workspace management, dependency resolution, and some amount of name binding and symbol resolution, just as a few examples. An overview of the compilation process is available as a comment inside of the compiler.Compile function, although it is currently unimplemented. The relationship between Workspace and Compiler has been semi- inverted, such that all Compiler instances require a Workspace object. This is more natural anyway and moves some of the detection logic "outside" of the Compiler. Similarly, Options has moved to a top-level package, so that Workspace and Compiler may share access to it without causing package import cycles. Finally, all that templating crap is gone. This alone is cause for mass celebration!
19 lines
423 B
Go
19 lines
423 B
Go
// Copyright 2016 Marapongo, Inc. 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...)))
|
|
}
|