psu/util/errors.go

14 lines
201 B
Go
Raw Normal View History

package util
2019-07-21 02:00:04 +00:00
import (
2019-07-24 02:43:23 +00:00
"fmt"
2019-07-21 02:00:04 +00:00
"log"
)
// CheckError checks if an error occurred (it's not nil)
func CheckError(err error) {
if err != nil {
2019-07-24 02:43:23 +00:00
log.Fatalln(fmt.Sprintf("Error: %s", err.Error()))
2019-07-21 02:00:04 +00:00
}
}