• Ian Lance Taylor's avatar
    net: Fix race condition in test. · 9e441e52
    Ian Lance Taylor authored
    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
    9e441e52
dnsname_test.go 1.35 KB