Skip to content

Commit

Permalink
Don't drop errors in scanAll
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed Nov 16, 2016
1 parent 5f97679 commit 77ff2b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sqlx.go
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,9 @@ func scanAll(rows rowsi, dest interface{}, structOnly bool) error {
v = reflect.Indirect(vp)

err = fieldsByTraversal(v, fields, values, true)
if err != nil {
return err
}

// scan into the struct field pointers and append to our results
err = rows.Scan(values...)
Expand All @@ -919,6 +922,9 @@ func scanAll(rows rowsi, dest interface{}, structOnly bool) error {
for rows.Next() {
vp = reflect.New(base)
err = rows.Scan(vp.Interface())
if err != nil {
return err
}
// append
if isPtr {
direct.Set(reflect.Append(direct, vp))
Expand Down

0 comments on commit 77ff2b8

Please sign in to comment.