aboutsummaryrefslogtreecommitdiff
path: root/template/go/snip-signal.go
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2013-10-25 09:21:45 +0900
committermattn <mattn.jp@gmail.com>2013-10-25 09:21:45 +0900
commite4c3bde602554da9c75a4a82391ddaa5014e582d (patch)
treee426268362d283864588cbd4be3804555dbae353 /template/go/snip-signal.go
parent71c369775f1ca0553042ccec83c29c4756697e9b (diff)
downloadvim-sonictemplate-e4c3bde602554da9c75a4a82391ddaa5014e582d.tar.gz
vim-sonictemplate-e4c3bde602554da9c75a4a82391ddaa5014e582d.tar.bz2
vim-sonictemplate-e4c3bde602554da9c75a4a82391ddaa5014e582d.zip
Add signal handler
Diffstat (limited to 'template/go/snip-signal.go')
-rw-r--r--template/go/snip-signal.go7
1 files changed, 7 insertions, 0 deletions
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_}}
+ }
+}()