mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 03:14:55 +02:00
nvim/snippets/go.lua: add snippet for if error case
This commit is contained in:
parent
846f15666b
commit
c8637d1aee
1 changed files with 6 additions and 0 deletions
|
|
@ -5,6 +5,12 @@ local t = ls.text_node
|
|||
local i = ls.insert_node
|
||||
|
||||
return {
|
||||
s("iferr", {
|
||||
t({"if err != nil {", ""}),
|
||||
t({"\treturn err", ""}),
|
||||
t({"}"})
|
||||
}),
|
||||
|
||||
-- Test function
|
||||
s("tst", {
|
||||
t("func Test"), i(1, "Module"), t("_"), i(2, "Name"), t({"(t *testing.T) {", ""}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue