aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorHiroaki Sano <hiroaki.sano.9stories@gmail.com>2020-01-27 23:10:38 +0900
committerHiroaki Sano <hiroaki.sano.9stories@gmail.com>2020-01-27 23:54:13 +0900
commit0a50049b8b828c3235f80ecc2c95b936376cf763 (patch)
tree843cd20b259593939d2e36a4646b56929e113f8c /template
parent23716b7b708853a51b585e0a2f8c7bbc5e09d2a9 (diff)
downloadvim-sonictemplate-0a50049b8b828c3235f80ecc2c95b936376cf763.tar.gz
vim-sonictemplate-0a50049b8b828c3235f80ecc2c95b936376cf763.tar.bz2
vim-sonictemplate-0a50049b8b828c3235f80ecc2c95b936376cf763.zip
Add err handling
Diffstat (limited to 'template')
-rw-r--r--template/go/snip-err-log-fatal.go3
-rw-r--r--template/go/snip-err-return.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/template/go/snip-err-log-fatal.go b/template/go/snip-err-log-fatal.go
new file mode 100644
index 0000000..48a2c6b
--- /dev/null
+++ b/template/go/snip-err-log-fatal.go
@@ -0,0 +1,3 @@
+if err != nil {
+ log.Fatal(err)
+}
diff --git a/template/go/snip-err-return.go b/template/go/snip-err-return.go
new file mode 100644
index 0000000..4936685
--- /dev/null
+++ b/template/go/snip-err-return.go
@@ -0,0 +1,3 @@
+if err != nil {
+ return err
+}