github.com/guilhermebr/docker@v1.4.2-0.20150428121140-67da055cebca/pkg/signal/signal.go (about) 1 package signal 2 3 import ( 4 "os" 5 "os/signal" 6 ) 7 8 func CatchAll(sigc chan os.Signal) { 9 handledSigs := []os.Signal{} 10 for _, s := range SignalMap { 11 handledSigs = append(handledSigs, s) 12 } 13 signal.Notify(sigc, handledSigs...) 14 } 15 16 func StopCatch(sigc chan os.Signal) { 17 signal.Stop(sigc) 18 close(sigc) 19 }