mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
22 lines
299 B
Go
22 lines
299 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 CheckErrExit(err error, s ...string) {
|
|
if err != nil {
|
|
CheckErr(err, s...)
|
|
os.Exit(-1)
|
|
}
|
|
}
|