wrapcheck
wrapcheck copied to clipboard
Support Gorm-style error checking
Gorm uses non-standard error format to support it's chainable API. It would be nice if there was a way to configure wrapcheck to match a *.\.Error
regex
tx := tx.Find(&customer)
if tx.Error != nil {
return nil, tx.Error // wrapcheck should warn here
}
abc := tx.Find(&customer)
if abc.Error != nil {
return nil, abc.Error // wrapcheck should warn here
}
That should be possible, will just need a bit of a tweak to the AST matcher. I'll take a look when I get some time. If you want it sooner, I'm happy to review a PR.
@tomarrell any update on this? I would love to have support for Gorm