Cast to reflect.Value
nmiculinic opened this issue · comments
Neven Miculinic commented
This would be pretty nice building block for reflect type casting; something like:
cast.ToReflectValue(i interface{}, value reflect.Values) error
Bjørn Erik Pedersen commented
What is reflect.Values
and what is its purpose in that function?
What's wrong with just doing v := reflect.ValueOf(i)
?
Neven Miculinic commented
I want to set it. That is for example:
cast.ToReflectValues("10s", x)
would set the x to duration 10s if x is of type duration