Add QRM error if result set is empty when scanning into struct destination.
This commit is contained in:
parent
02fafd8a7a
commit
8c9ae77cd8
6 changed files with 61 additions and 22 deletions
|
|
@ -38,7 +38,7 @@ func Query(ctx context.Context, db DB, query string, args []interface{}, destPtr
|
|||
}
|
||||
|
||||
if tempSliceValue.Len() == 0 {
|
||||
return nil
|
||||
return sql.ErrNoRows
|
||||
}
|
||||
|
||||
structValue := reflect.ValueOf(destPtr).Elem()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue