From e744bc09fae141e2f753176149eb0c442b14d931 Mon Sep 17 00:00:00 2001 From: luk3skyw4lker Date: Mon, 1 Jul 2024 12:52:50 -0300 Subject: [PATCH] refactor: change some error returns to nil instead of &Storage --- clickhouse/clickhouse.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clickhouse/clickhouse.go b/clickhouse/clickhouse.go index 5f982f3f..d033afed 100644 --- a/clickhouse/clickhouse.go +++ b/clickhouse/clickhouse.go @@ -32,17 +32,16 @@ func New(configuration Config) (*Storage, error) { queryWithEngine := fmt.Sprintf(createTableString, engine) if err := conn.Exec(ctx, queryWithEngine, driver.Named("table", configuration.Table)); err != nil { - return &Storage{}, err + return nil, err } if configuration.Clean { if err := conn.Exec(ctx, resetDataString, driver.Named("table", configuration.Table)); err != nil { - return &Storage{}, err + return nil, err } } - err = conn.Ping(ctx) - if err != nil { + if err := conn.Ping(ctx); err != nil { return nil, err }