mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Clean up server & build site logic. Fixed #94
This commit is contained in:
22
utils/utils.go
Normal file
22
utils/utils.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user