]> Cypherpunks repositories - gostls13.git/commit
net: Fix race condition in test.
authorIan Lance Taylor <iant@golang.org>
Fri, 21 Jan 2011 21:57:52 +0000 (13:57 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 21 Jan 2011 21:57:52 +0000 (13:57 -0800)
commit9e441e52156d3b5c795083544745c53124c6df4e
treeac6c39dfead780ab99f7f830fc7088fb4051da1b
parent27c74d3499b12288fb4a944ce5376820dee1c8b1
net: Fix race condition in test.

The test code used to do this:

for _, tc := range tests {
ch <- &tc
}

Note that &tc is always the same value here.  As the value is
received from the channel, the sender can loop around and
change the contents of tc.  This means that the receiver's
value is unstable and can change while it is in use.

R=adg, r2, rsc
CC=chris, golang-dev
https://golang.org/cl/3978043
src/pkg/net/dnsname_test.go