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

fix: it didn't work correctly when the import path contains "." #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

neglect-yp
Copy link

This PR fixes that called doesn't work correctly when an import path contains ..

An import path contains . when the target function is imported from an external package. So, the format for -called.funcs should be like github.com/gostaticanalysis/pkg.Func in this case. However, the following line splits a passed function name by . to get the package name, type name and function/method name:

ss := strings.Split(strings.TrimSpace(fn), ".")

For example, github.com/gostaticanalysis/pkg.Func is split into ["github", "com/gostaticanalysis/pkg", "Func"] .

⚠️ BREAKING CHANGE

  • () is required when specifying methods in -called.funcs
    • This is the same behavior as -printf.funcs for printf analyzer

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

Successfully merging this pull request may close these issues.

None yet

1 participant