mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-06-08 18:41:48 -04:00
29 lines
296 B
Go
29 lines
296 B
Go
// +build windows
|
|
|
|
package signals
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
)
|
|
|
|
func init() {
|
|
signal.Notify(sigChan, os.Interrupt)
|
|
}
|
|
|
|
func Handle() {
|
|
for {
|
|
sig, ok := <-sigChan
|
|
if !ok {
|
|
// closed channel
|
|
return
|
|
}
|
|
if sig == os.Interrupt {
|
|
handleInterrupted()
|
|
} else {
|
|
// wtf?
|
|
}
|
|
}
|
|
|
|
}
|