mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05: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)
|
|
}
|
|
}
|