summaryrefslogtreecommitdiff
path: root/vim-extra/.config/nvim/UltiSnips/go.snippets
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-03-02 16:04:14 +0100
committerJulian T <julian@jtle.dk>2021-03-02 16:04:14 +0100
commit1e2b07b971cc136e3f739d94888a5bd5fc1c594a (patch)
tree432447d2b02d44b74d18d19abf1a267f2a150370 /vim-extra/.config/nvim/UltiSnips/go.snippets
parente2e843955110e9332215ec65be20d45431a002bc (diff)
Add snippits for nvim
Diffstat (limited to 'vim-extra/.config/nvim/UltiSnips/go.snippets')
-rw-r--r--vim-extra/.config/nvim/UltiSnips/go.snippets14
1 files changed, 14 insertions, 0 deletions
diff --git a/vim-extra/.config/nvim/UltiSnips/go.snippets b/vim-extra/.config/nvim/UltiSnips/go.snippets
new file mode 100644
index 0000000..96a9fec
--- /dev/null
+++ b/vim-extra/.config/nvim/UltiSnips/go.snippets
@@ -0,0 +1,14 @@
+snippet ec "if err no nil"
+if err != nil {
+ return $1err
+}
+$0
+endsnippet
+
+snippet eh "if err no nil write http"
+if err != nil {
+ ${1:http}.Error(w, err.Error(), http.Status${2:InternalServerError})
+ return
+}
+$0
+endsnippet