Move util.CheckError to common.CheckError

This commit is contained in:
Juan Carlos Mejías Rodríguez
2019-08-03 09:51:11 -04:00
parent 3989715b70
commit 356979a7a4
8 changed files with 54 additions and 42 deletions

13
common/errors.go Normal file
View File

@ -0,0 +1,13 @@
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()))
}
}