Shorthand for empty channels

This commit is contained in:
Jason A. Donenfeld 2018-05-14 04:19:25 +02:00
parent b76ab82539
commit 25df2e6942
3 changed files with 3 additions and 3 deletions

View file

@ -293,7 +293,7 @@ func NewDevice(tun TUNDevice, logger *Logger) *Device {
// prepare signals // prepare signals
device.signals.stop = make(chan struct{}, 0) device.signals.stop = make(chan struct{})
// prepare net // prepare net

View file

@ -117,7 +117,7 @@ func CreateTUNFromFile(file *os.File) (TUNDevice, error) {
mtu: 1500, mtu: 1500,
events: make(chan TUNEvent, 10), events: make(chan TUNEvent, 10),
errors: make(chan error, 1), errors: make(chan error, 1),
statusListenersShutdown: make(chan struct{}, 0), statusListenersShutdown: make(chan struct{}),
} }
_, err := tun.Name() _, err := tun.Name()

View file

@ -399,7 +399,7 @@ func CreateTUNFromFile(fd *os.File) (TUNDevice, error) {
fd: fd, fd: fd,
events: make(chan TUNEvent, 5), events: make(chan TUNEvent, 5),
errors: make(chan error, 5), errors: make(chan error, 5),
statusListenersShutdown: make(chan struct{}, 0), statusListenersShutdown: make(chan struct{}),
nopi: false, nopi: false,
} }
var err error var err error