Add showimp to commands.

This commit is contained in:
Kyle
2015-09-22 11:25:54 -07:00
parent 27819dbf0e
commit 4b3f1037b3
3 changed files with 140 additions and 0 deletions

View File

@@ -45,3 +45,12 @@ func Err(exit int, err error, format string, a ...interface{}) {
fmt.Fprintf(os.Stderr, format, a...)
os.Exit(exit)
}
// CheckFatal calls Err if err isn't nil.
func CheckFatal(err error, format string, a ...interface{}) {
if err == nil {
return
}
Err(ExitFailure, err, format, a...)
}