Created
January 3, 2018 17:27
-
-
Save zerbitx/618163aefd482b2a76caf5e39af3f040 to your computer and use it in GitHub Desktop.
Too much effort for a joke.
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
"github.com/erikdubbelboer/gspt" | |
) | |
func main() { | |
c := make(chan os.Signal) | |
gspt.SetProcTitle("A function has no name") | |
signal.Notify(c, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) | |
for { | |
select { | |
case sig := <-c: | |
if sig == syscall.SIGQUIT { | |
return | |
} | |
fmt.Println("!today") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment