[orm] QueryTable with nil ptr struct

This commit is contained in:
bronze1man
2013-11-24 14:26:32 +08:00
parent a0dff9148a
commit ceb4aa9e25
3 changed files with 12 additions and 3 deletions

View File

@@ -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
}