mirror of https://github.com/jackc/pgx.git
Updated CopyFromSlice example in doc.go
The example had a syntax error and didn't explain what user was to begin with. Fixed it.pull/901/head
parent
fc4d50f6c2
commit
b664891853
2
doc.go
2
doc.go
|
@ -289,7 +289,7 @@ When you already have a typed array using CopyFromSlice can be more convenient.
|
||||||
pgx.Identifier{"people"},
|
pgx.Identifier{"people"},
|
||||||
[]string{"first_name", "last_name", "age"},
|
[]string{"first_name", "last_name", "age"},
|
||||||
pgx.CopyFromSlice(len(rows), func(i int) ([]interface{}, error) {
|
pgx.CopyFromSlice(len(rows), func(i int) ([]interface{}, error) {
|
||||||
return []interface{user.FirstName, user.LastName, user.Age}, nil
|
return []interface{}{rows[i].FirstName, rows[i].LastName, rows[i].Age}, nil
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue