mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 21:32:06 -05:00
22 lines
296 B
Go
22 lines
296 B
Go
package utils
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
func CheckErr(err error, s ...string) {
|
|
if err != nil {
|
|
for _, message := range s {
|
|
log.Fatalf(message)
|
|
}
|
|
log.Fatalf("Fatal Error: %v", err)
|
|
}
|
|
}
|
|
|
|
func StopOnErr(err error, s ...string) {
|
|
if err != nil {
|
|
CheckErr(err, s...)
|
|
os.Exit(-1)
|
|
}
|
|
}
|