Created
April 18, 2019 15:02
-
-
Save piotrpersona/d912c8ec58601464054111b19d490759 to your computer and use it in GitHub Desktop.
Golang signal handling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signalChannel := make(chan os.Signal, 1) | |
signal.Notify(signalChannel, os.Interrupt) | |
go func(){ | |
for sig := range signalChannel { | |
// fmt.Println(sig) | |
} | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment