QRM returns sql.ErrNoRows when scanning into struct destination and query result set is empty.

This commit is contained in:
go-jet 2019-10-12 18:45:09 +02:00
parent 3544977d7f
commit f9efee77ff
7 changed files with 103 additions and 90 deletions

View file

@ -33,14 +33,9 @@ func getScanner(value reflect.Value) sql.Scanner {
func getSliceElemType(slicePtrValue reflect.Value) reflect.Type {
sliceTypePtr := slicePtrValue.Type()
elemType := indirectType(sliceTypePtr).Elem()
elemType := sliceTypePtr.Elem().Elem()
if elemType.Kind() == reflect.Ptr {
return elemType.Elem()
}
return elemType
return indirectType(elemType)
}
func getSliceElemPtrAt(slicePtrValue reflect.Value, index int) reflect.Value {