Skip to content

Commit be519f7

Browse files
b4nstlpil
authored andcommitted
feat(go): update error wrap snippet
1 parent 0a2c735 commit be519f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

snippets/go.snippets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ snippet ja "Marshalable json alias"
274274
}
275275

276276

277-
snippet errwr "Error handling with errors.Wrap"
277+
snippet errwr "Error handling with fmt.Errorf"
278278
if ${1}err != nil {
279-
return errors.Wrap(err, "${2}")
279+
return fmt.Errorf("${2} %w", err)
280280
}

0 commit comments

Comments
 (0)