A pointer to X is a distinct type from X.
If reflect.Value
references a pointer to a value, you can get a reference to the value by calling Elem()
.
https://codeeval.dev/gist/7f1f62e411f79377733c1a1aafc4c5fc
Under the hood an interface is also a pointer to its underlying value so Elem()
also works on reflect.Value
representing interface.