[orm] QueryTable with nil ptr struct
This commit is contained in:
10
orm/utils.go
10
orm/utils.go
@@ -231,3 +231,13 @@ func timeParse(dateString, format string) (time.Time, error) {
|
||||
func timeFormat(t time.Time, format string) string {
|
||||
return t.Format(format)
|
||||
}
|
||||
|
||||
func indirectType(v reflect.Type) reflect.Type {
|
||||
switch v.Kind() {
|
||||
case reflect.Ptr:
|
||||
return indirectType(v.Elem())
|
||||
default:
|
||||
return v
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user