reflect: implement Value.CanAddr

It is used in the crypto/sha512 test, for example. And it is very simple
to implement.
This commit is contained in:
Ayke van Laethem
2021-03-24 23:13:15 +01:00
committed by Ron Evans
parent bcce296ca3
commit 2aa2e750b9
3 changed files with 35 additions and 32 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ func (v Value) CanInterface() bool {
}
func (v Value) CanAddr() bool {
panic("unimplemented: (reflect.Value).CanAddr()")
return v.flags&(valueFlagIndirect) == valueFlagIndirect
}
func (v Value) Addr() Value {