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 for G402. Check package path instead of package name #838

Merged
merged 1 commit into from Jul 28, 2022

Conversation

TimonOmsk
Copy link
Contributor

@TimonOmsk TimonOmsk commented Jul 27, 2022

This PR fixes #820 issue

This PR contains several changes

  1. Check package path instead of package name.
    Comparing by package path is more trustful than comparing by package name. It's the only source of truth(after resolving the aliases) to check what exactly package was imported(=accessed in our case).

  2. Move "unaliasing" from GetImportedName to GetImportPath
    It will help us to get exact information about imported package.

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.

gosec does not respect the go package import alias
2 participants