// Listen waits for provided OS signals.
// It will wait for any signal if no signals provided.
Listen waits for provided OS signals.
It will wait for any signal if no signals provided.
// Listen waits for provided OS signals . // It will wait for any signal if no signals provided .
func (s *Shutdown) Listen(signals ...os.Signal) {
	ch := make(chan os.Signal, 1)
	signal.Notify(ch, signals...)
	sig := <-ch
	var wg sync.WaitGroup
	for _, fn := range s.Hooks() {
		wg.Add(1)
		go func(sig os.Signal, fn func(os.Signal)) {
			defer wg.Done()
			fn(sig)
		}(sig, fn)
	}
	wg.Wait()
}
func ( s * Shutdown ) Listen ( signals ... os . Signal ) { ch := make ( chan os . Signal , 1 ) signal . Notify ( ch , signals ... ) sig := <- ch var wg sync . WaitGroup for _ , fn := range s . Hooks ( ) { wg . Add ( 1 ) go func ( sig os . Signal , fn func ( os . Signal ) ) { defer wg . Done ( ) fn ( sig ) } ( sig , fn ) } wg . Wait ( ) }
Listen waits for provided OS signals.
Listen waits for provided OS signals .