Skip to content

Commit

Permalink
refactor: change some error returns to nil instead of &Storage
Browse files Browse the repository at this point in the history
  • Loading branch information
luk3skyw4lker committed Jul 1, 2024
1 parent 0228c63 commit e744bc0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit e744bc0

Please sign in to comment.