door_linux.go 233 B

1234567891011121314
  1. package door
  2. func (d *Door) setupChannels() {
  3. if d.ReaderCanClose {
  4. // Yes, expect Reader and Writer to stop
  5. d.wg.Add(2)
  6. } else {
  7. // Default: Only wait for the Writer to stop
  8. d.wg.Add(1)
  9. }
  10. go Reader(d)
  11. go Writer(d)
  12. }