reflect: implement PtrTo

This commit is contained in:
Ayke van Laethem
2020-01-22 20:05:36 +01:00
committed by Ron Evans
parent 36db75b366
commit 3010466c55
2 changed files with 15 additions and 0 deletions
+7
View File
@@ -265,6 +265,13 @@ func main() {
println("type assertion failed (but should succeed)")
}
if reflect.TypeOf(new(myint)) != reflect.PtrTo(reflect.TypeOf(myint(0))) {
println("PtrTo failed for type myint")
}
if reflect.TypeOf(new(myslice)) != reflect.PtrTo(reflect.TypeOf(make(myslice, 0))) {
println("PtrTo failed for type myslice")
}
println("\nstruct tags")
TestStructTag()
}