1
0
Fork 0
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:
Henrik Hautakoski 2024-08-13 15:31:39 +02:00
parent 846f15666b
commit c8637d1aee

View file

@ -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) {", ""}),