From b6648918538573919deaf55ec6f9f3c29e34412b Mon Sep 17 00:00:00 2001 From: Musbah Sinno Date: Sun, 20 Dec 2020 15:33:48 -0500 Subject: [PATCH] Updated CopyFromSlice example in doc.go The example had a syntax error and didn't explain what user was to begin with. Fixed it. --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc.go b/doc.go index 8dce15e7..b27708d6 100644 --- a/doc.go +++ b/doc.go @@ -289,7 +289,7 @@ When you already have a typed array using CopyFromSlice can be more convenient. pgx.Identifier{"people"}, []string{"first_name", "last_name", "age"}, 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 }), )