mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 01:02:47 +00:00
24 lines
347 B
Go
24 lines
347 B
Go
package utils
|
|
|
|
import (
|
|
"os"
|
|
|
|
jww "github.com/spf13/jwalterweatherman"
|
|
)
|
|
|
|
func CheckErr(err error, s ...string) {
|
|
if err != nil {
|
|
for _, message := range s {
|
|
jww.ERROR.Println(message)
|
|
}
|
|
}
|
|
}
|
|
|
|
func StopOnErr(err error, s ...string) {
|
|
if err != nil {
|
|
for _, message := range s {
|
|
jww.CRITICAL.Println(message)
|
|
}
|
|
os.Exit(-1)
|
|
}
|
|
}
|