package util

import "log"

//This function take a function that returns an error, if err is not nil it will exit with log.Fatal.
func RunOrFail(fn func() error) {
	if err := fn(); err != nil {
		log.Fatal(err)
	}
}

//Performs a check on error and exits with log.Fatal if it is not nil.
func ErrHandler(err error) {
	if err != nil {
		log.Fatal(err)
	}
}
