diff --git a/container_option.go b/container_option.go index e4254f6..a858c3c 100644 --- a/container_option.go +++ b/container_option.go @@ -62,7 +62,11 @@ // have been rendered. func WithShutdownNotifier(ch chan struct{}) ContainerOption { return func(s *pState) { - s.shutdownNotifier = ch + select { + case <-ch: + default: + s.shutdownNotifier = ch + } } }