Update doc example for pgx.ForEachRow
fixes https://github.com/jackc/pgx/issues/1360
This commit is contained in:
@@ -40,7 +40,7 @@ directly.
|
||||
|
||||
var sum, n int32
|
||||
rows, _ := conn.Query(context.Background(), "select generate_series(1,$1)", 10)
|
||||
_, err := pgx.ForEachRow(rows, []any{&n}, func(pgx.QueryFuncRow) error {
|
||||
_, err := pgx.ForEachRow(rows, []any{&n}, func() error {
|
||||
sum += n
|
||||
return nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user