*really* fix the race in mock
@@ -64,7 +64,7 @@ func (s *stream) Write(p []byte) (n int, err error) {
select {
case <-s.closed: // bail out if we're closing.
return 0, s.writeErr
- case s.toDeliver <- &transportObject{msg: p, arrivalTime: t}:
+ case s.toDeliver <- &transportObject{msg: cpy, arrivalTime: t}:
}
return len(p), nil
}
