feat(nvim) add an "iferr" snippet for go
This commit is contained in:
parent
db8e668e53
commit
67c4d1d4b4
1 changed files with 5 additions and 0 deletions
|
@ -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}}
|
||||
|
|
Loading…
Add table
Reference in a new issue