mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 04:34:09 +00: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)
|
|
}
|
|
}
|