]> Cypherpunks repositories - gostls13.git/commit
reflect: add PtrTo, add Value.Addr (old Addr is now UnsafeAddr)
authorRuss Cox <rsc@golang.org>
Thu, 3 Mar 2011 18:20:17 +0000 (13:20 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 3 Mar 2011 18:20:17 +0000 (13:20 -0500)
commite46acb091fa7dfbdb99e61801f37522bd8b80365
tree9bfdf2226380bf26219f9b7cd95b3f5158ca0b06
parent44fd7573aacd4780a3a70cec43e7ad8dea542c7f
reflect: add PtrTo, add Value.Addr (old Addr is now UnsafeAddr)

This change makes it possible to take the address of a
struct field or slice element in order to call a method that
requires a pointer receiver.

Existing code that uses the Value.Addr method will have
to change (as gob does in this CL) to call UnsafeAddr instead.

R=r, rog
CC=golang-dev
https://golang.org/cl/4239052
src/pkg/gob/decode.go
src/pkg/gob/encode.go
src/pkg/reflect/all_test.go
src/pkg/reflect/deepequal.go
src/pkg/reflect/type.go
src/pkg/reflect/value.go