blob: 530e9b49e387a86795df4ff6651da609a8d6e63f [file] [log] [blame]
// +build ignore,OMIT
package sample // OMIT
type Stream struct {
// some fields
cc chan struct{} // HL
}
func (s *Stream) Wait() error {
<-s.cc
// some code
}
func (s *Stream) Close() {
// some code
close(s.cc)
}
func (s *Stream) IsClosed() bool {
select {
case <-s.cc:
return true
default:
return false
}
}