| // Copyright 2015 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func (myError) Error() string { return "" } |
| func doRequest(useSelect bool) (*response, error) { |
| ch := make(chan *async, 0) |
| done := make(chan struct{}, 0) |
| case ch <- &async{resp: nil, err: myError{}}: |
| ch <- &async{resp: nil, err: myError{}} |
| func TestChanSendSelectBarrier(t *testing.T) { |
| testChanSendBarrier(true) |
| func TestChanSendBarrier(t *testing.T) { |
| testChanSendBarrier(false) |
| func testChanSendBarrier(useSelect bool) { |
| for i := 0; i < outer; i++ { |
| for j := 0; j < inner; j++ { |
| _, err := doRequest(useSelect) |
| garbage = make([]byte, 1<<10) |