watchyourlan/internal/check/error.go
2024-06-30 01:17:35 +07:00

16 lines
206 B
Go

package check
import (
"fmt"
"log/slog"
)
// IfError prints error, if it is not nil
func IfError(err error) bool {
if err == nil {
return false
}
slog.Error(fmt.Sprintf("%v", err))
return true
}