Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Gorm-style error checking #32

Open
cdignam-segment opened this issue Jun 24, 2022 · 3 comments
Open

Support Gorm-style error checking #32

cdignam-segment opened this issue Jun 24, 2022 · 3 comments

Comments

@cdignam-segment
Copy link

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
}
@tomarrell
Copy link
Owner

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.

@davideme
Copy link

davideme commented May 9, 2024

@tomarrell any update on this? I would love to have support for Gorm

@tomarrell
Copy link
Owner

@davideme Hey, sorry, I've not got a large amount of time outside my day-job in order to tackle this. I would be able to review a PR, or give some guidance if you wanted to give it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants