Skip to content

Commit

Permalink
add missing rows.close
Browse files Browse the repository at this point in the history
  • Loading branch information
yinloo-ola committed Dec 14, 2023
1 parent a18c33f commit 5add688
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions coredb/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func RowsToStructSliceReflect(rows *sql.Rows, out any) (err error) {
if rows == nil {
return
}
defer rows.Close()
sliceValue := reflect.ValueOf(out)
if sliceValue.Kind() != reflect.Ptr || sliceValue.IsNil() {
panic(&InvalidScanError{Type: sliceValue.Type()})
Expand Down

0 comments on commit 5add688

Please sign in to comment.