Skip to content

Commit

Permalink
Update postgres.go
Browse files Browse the repository at this point in the history
 run the Go formatting tool (gofumpt).
  • Loading branch information
Jack397419 committed Oct 30, 2023
1 parent 4aa1955 commit 78c9aea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bindings/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,20 +186,20 @@ func (p *Postgres) query(ctx context.Context, sql string, args ...any) (result [
return nil, fmt.Errorf("error executing query: %w", err)
}

cols := rows.FieldDescriptions()
cols := rows.FieldDescriptions()

rs := make([]any, 0)
for rows.Next() {
val, rowErr := rows.Values()
if rowErr != nil {
return nil, fmt.Errorf("error reading result '%v': %w", rows.Err(), rowErr)
}

r := map[string]interface{}{}
for i, col := range cols {
r[string(col.Name)] = val[i]
}

rs = append(rs, r) //nolint:asasalint
}

Expand Down

0 comments on commit 78c9aea

Please sign in to comment.