Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.

Commit a054340

Browse files
committed
don't require sending to closeChan
the reader only needs to close closeChan when they are done
1 parent 8682e09 commit a054340

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

dockerclient_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ func TestContainerStats(t *testing.T) {
178178
}
179179
t.Logf("done with iter %d\n", j)
180180
}
181-
closeChan <- struct{}{}
182181
close(closeChan)
183182
t.Logf("done with outer iter %d\n", i)
184183
}

interface.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ type Client interface {
1515
// ContainerStats returns a stats channel, an error channel, and a close
1616
// channel. Users should select on the stats and error channels. If
1717
// anything is sent on the error channels, then no more stats will be
18-
// sent. Users must always send a struct{}{} to the close channel when
19-
// they are done reading stats, even if an error was sent.
18+
// sent. Users must close the close channel when they are done reading stats,
19+
// even if an error was sent.
2020
ContainerStats(id string) (<-chan Stats, <-chan error, chan<- struct{}, error)
2121
Exec(config *ExecConfig) (string, error)
2222
StartContainer(id string, config *HostConfig) error

0 commit comments

Comments
 (0)