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

26 lines
454 B
Go
Raw Normal View History

2018-12-22 17:38:56 +04:00
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)
}
}