WithShutdownNotifier: don't accept closed chan
Vladimir Bauer
4 years ago
| 61 | 61 |
// have been rendered.
|
| 62 | 62 |
func WithShutdownNotifier(ch chan struct{}) ContainerOption {
|
| 63 | 63 |
return func(s *pState) {
|
| 64 | |
s.shutdownNotifier = ch
|
|
64 |
select {
|
|
65 |
case <-ch:
|
|
66 |
default:
|
|
67 |
s.shutdownNotifier = ch
|
|
68 |
}
|
| 65 | 69 |
}
|
| 66 | 70 |
}
|
| 67 | 71 |
|