|
@@ -152,6 +152,12 @@ func New(s string) (Model, error) {
|
|
}
|
|
}
|
|
|
|
|
|
func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
|
func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
|
|
|
+ var iface bool
|
|
|
|
+ if v.Kind() == reflect.Interface {
|
|
|
|
+ iface = true
|
|
|
|
+ v = v.Elem()
|
|
|
|
+ }
|
|
|
|
+
|
|
t := v.Type()
|
|
t := v.Type()
|
|
if t.Kind() == reflect.Pointer {
|
|
if t.Kind() == reflect.Pointer {
|
|
t, v = t.Elem(), v.Elem()
|
|
t, v = t.Elem(), v.Elem()
|
|
@@ -230,6 +236,10 @@ func populateFields(b ml.Backend, v reflect.Value, tags ...Tag) reflect.Value {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if iface {
|
|
|
|
+ return v.Addr()
|
|
|
|
+ }
|
|
|
|
+
|
|
return v
|
|
return v
|
|
}
|
|
}
|
|
|
|
|