]> Cypherpunks repositories - gostls13.git/commit
net: document that user shouldn't modify returned Addr
authorShenghou Ma <minux@golang.org>
Tue, 3 Feb 2015 17:59:40 +0000 (12:59 -0500)
committerMinux Ma <minux@golang.org>
Fri, 6 Feb 2015 19:21:40 +0000 (19:21 +0000)
commit7e43aee3016006fb74760d1936fb1ce6d2d08560
tree3d02d331f52d0b36802b8de880f2cf7eec703ecb
parent4ce06f4b5caab3874f30f14551aa3f8e08f2de3e
net: document that user shouldn't modify returned Addr

Ideally, those methods should return a copy of the Addr, but
due to the Go 1 API guarantee, we cannot make that change now:
there might exist client code that uses the returned Addr as
map index and thus relies on the fact that different invocation
of the method returns the same pointer. Changing this behavior
will lead to hidden behaviour change in those programs.

Update #9654.

Change-Id: Iad4235f2ed7789b3a3c8e0993b9718cf0534ea2b
Reviewed-on: https://go-review.googlesource.com/3851
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/net.go
src/net/tcpsock_plan9.go
src/net/tcpsock_posix.go
src/net/unixsock_plan9.go
src/net/unixsock_posix.go