From e4c3bde602554da9c75a4a82391ddaa5014e582d Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 25 Oct 2013 09:21:45 +0900 Subject: Add signal handler --- template/go/snip-signal.go | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 template/go/snip-signal.go (limited to 'template/go/snip-signal.go') diff --git a/template/go/snip-signal.go b/template/go/snip-signal.go new file mode 100644 index 0000000..726a50b --- /dev/null +++ b/template/go/snip-signal.go @@ -0,0 +1,7 @@ +sc := make(chan os.Signal, 1) +signal.Notify(sc, os.Interrupt) +go func(){ + for sig := range sc { + {{_cursor_}} + } +}() -- cgit v1.2.3-54-g00ecf