func DatabasePingCheck(database *sql.DB, timeout time.Duration) Check {
	return func() error {
		ctx, cancel := context.WithTimeout(context.Background(), timeout)
		defer cancel()
		if database == nil {
			return fmt.Errorf("database is nil")
		}
		return database.PingContext(ctx)
	}
}
func DatabasePingCheck(database *sql.DB, timeout time.Duration) Check {
	return func() error {
		ctx, cancel := context.WithTimeout(context.Background(), timeout)
		defer cancel()
		if database == nil {
			return fmt.Errorf("database is nil")
		}
		return database.PingContext(ctx)
	}
}
func DatabasePingCheck ( database * sql . DB , timeout time . Duration ) Check { return func ( ) error { ctx , cancel := context . WithTimeout ( context . Background ( ) , timeout ) defer cancel ( ) if database == nil { return fmt . Errorf ( " " ) } return database . PingContext ( ctx ) } }
// DatabasePingCheck returns a Check that validates connectivity to a
// database/sql.DB using Ping().
DatabasePingCheck returns a Check that validates connectivity to a database / sql . DB using Ping () .