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

problem with func return values #315

Closed
peakle opened this issue Dec 18, 2021 · 2 comments · Fixed by #342
Closed

problem with func return values #315

peakle opened this issue Dec 18, 2021 · 2 comments · Fixed by #342
Labels
bug Something isn't working

Comments

@peakle
Copy link
Contributor

peakle commented Dec 18, 2021

have problems with few function return values, tried use $*_, $_ and $a patterns, result the same, i don't have errors on compilation, but also functions were not found, with one return parameter everything is fine

problem example - https://github.com/delivery-club/delivery-club-rules/blob/main/rules.go#L184
m.Match("func $name($*_) ($arg, $_) { $*_ }")

@quasilyte
Copy link
Owner

I believe the problem is that errors in the pattern is probably not from stdlib package.
There is a lack of ruleguard<->gogrep communication here.

The ruleguard knows that errors refer to "github.com/pkg/errors" as there is an import above.
We need to teach gogrep to use that information.

I'll work on that in the near future. This issue shouldn't be too hard to fix.

@quasilyte quasilyte added the bug Something isn't working label Jan 2, 2022
@peakle
Copy link
Contributor Author

peakle commented Jan 2, 2022

i should made explict pr for this changes or attach link on commit, but my example from main, so this is now outdated line
it was reference toreturnConcreteInsteadInterface rule, link based on commit:

rule: https://github.com/delivery-club/delivery-club-rules/blob/57c02e95e6292bd07d963c9be76750360df5ca41/rules.go#L184
testdata: https://github.com/delivery-club/delivery-club-rules/blob/57c02e95e6292bd07d963c9be76750360df5ca41/testdata/src/returnConcreteInsteadInterface/a.go#L50:L62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants