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
+4 -1
View File
@@ -315,7 +315,10 @@ func showValue(rv reflect.Value, indent string) {
}
print(indent+"reflect type: ", rt.Kind().String())
if rv.CanSet() {
print(" settable=", rv.CanSet())
print(" settable=true")
}
if rv.CanAddr() {
print(" addrable=true")
}
if !rt.Comparable() {
print(" comparable=false")