Archived
1
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
fwzookeeper/vendor/github.com/kirillDanshin/myutils/error_handlers.go
2018-11-29 20:32:51 +04:00

26 lines
454 B
Go

package myutils
import (
"log"
)
// LogFatalError it's a snippet for
// if err != nil {
// log.Fatalf("Error: %s", err)
// }
func LogFatalError(err error) {
if err != nil {
log.Fatalf("Error: %s", err)
}
}
// RequiredStrFatal it's a snippet for
// if str == "" {
// log.Fatalf("Error: %s is empty", name)
// }
func RequiredStrFatal(name, str string) {
if str == "" {
log.Fatalf("Error: %s is empty", name)
}
}