Closed lsmoura closed 1 year ago
returned errors should be wrapped using %w when adding decorations, so that they can be properly queried for using errors.Is or errors.As, such as:
%w
errors.Is
errors.As
if errors.Is(err, sqlite3.ErrBusy) || errors.Is(err, sqlite3.ErrLocked) { /* do something */ }
Thank you for this, LGTM!
returned errors should be wrapped using
%w
when adding decorations, so that they can be properly queried for usingerrors.Is
orerrors.As
, such as: