psu/common/errors.go

14 lines
203 B
Go
Raw Normal View History

package common
import (
"fmt"
"log"
)
// CheckError checks if an error occurred (it's not nil)
func CheckError(err error) {
if err != nil {
log.Fatalln(fmt.Sprintf("Error: %s", err.Error()))
}
}