Merge with main truk.
[official-gcc.git] / libgo / go / io / ioutil / blackhole.go
blob101d2c12153e6538bd33c3dea8fd65497d6a502c
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package ioutil
7 var blackHoleBuf = make(chan []byte, 1)
9 func blackHole() []byte {
10 select {
11 case b := <-blackHoleBuf:
12 return b
13 default:
15 return make([]byte, 8192)
18 func blackHolePut(p []byte) {
19 select {
20 case blackHoleBuf <- p:
21 default: