feat(nvim) add an "iferr" snippet for go

This commit is contained in:
Bruno Carlin 2022-03-30 10:38:40 +02:00
parent db8e668e53
commit 67c4d1d4b4

View file

@ -41,6 +41,11 @@ snippet if "If statement" b
${0:${VISUAL}}
}
snippet iferr "Error checking if statement" b
if ${1:err} != nil {
return ${2:val}${2/.+/, /}fmt.Errorf("${0:${VISUAL}}: %w", ${1})
}
snippet for "For statement" b
for ${1:test}${1/(.+)/ /}{
${0:${VISUAL}}