1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 // Interrupted is closed when the go command receives an interrupt signal.
14 var Interrupted
= make(chan struct{})
16 // processSignals setups signal handler.
17 func processSignals() {
18 sig
:= make(chan os
.Signal
)
19 signal
.Notify(sig
, signalsToIgnore
...)
26 var onceProcessSignals sync
.Once
28 // StartSigHandlers starts the signal handlers.
29 func StartSigHandlers() {
30 onceProcessSignals
.Do(processSignals
)