mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 16:30:01 +08:00
fix: fix ignored context.DeadlineExceeded (#4066)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package sqlx
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"reflect"
|
||||
"strings"
|
||||
@@ -87,6 +88,10 @@ func getValueInterface(value reflect.Value) (any, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func isScanFailed(err error) bool {
|
||||
return err != nil && !errors.Is(err, context.DeadlineExceeded)
|
||||
}
|
||||
|
||||
func mapStructFieldsIntoSlice(v reflect.Value, columns []string, strict bool) ([]any, error) {
|
||||
fields := unwrapFields(v)
|
||||
if strict && len(columns) < len(fields) {
|
||||
|
||||
Reference in New Issue
Block a user