mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-02 01:18:46 -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)
|
|
}
|
|
}
|