ValuesFromMapping now gets values

This commit is contained in:
Patrick O'brien 2016-09-06 01:24:19 +10:00
parent 7144d272bd
commit 41c36cadf3

View file

@ -322,8 +322,10 @@ func ptrFromMapping(val reflect.Value, mapping uint64, addressOf bool) reflect.V
v := (mapping >> uint(i*8)) & sentinel
if v == sentinel {
if val.Kind() != reflect.Ptr {
if addressOf && val.Kind() != reflect.Ptr {
return val.Addr()
} else if !addressOf && val.Kind() == reflect.Ptr {
return reflect.Indirect(val)
}
return val
}