Skip to content

Commit 8c228d7

Browse files
authored
Merge pull request #7 from bitpeng/ReadChan_should_return_receiveOnly_chan
change ReadChan to return receive-only chan
2 parents 74cfbc9 + 486ddd7 commit 8c228d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

diskqueue.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (l LogLevel) String() string {
4747

4848
type Interface interface {
4949
Put([]byte) error
50-
ReadChan() chan []byte // this is expected to be an *unbuffered* channel
50+
ReadChan() <-chan []byte // this is expected to be an *unbuffered* channel
5151
Close() error
5252
Delete() error
5353
Depth() int64
@@ -140,8 +140,8 @@ func (d *diskQueue) Depth() int64 {
140140
return atomic.LoadInt64(&d.depth)
141141
}
142142

143-
// ReadChan returns the []byte channel for reading data
144-
func (d *diskQueue) ReadChan() chan []byte {
143+
// ReadChan returns the receive-only []byte channel for reading data
144+
func (d *diskQueue) ReadChan() <-chan []byte {
145145
return d.readChan
146146
}
147147

0 commit comments

Comments
 (0)