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

Indirect dependencies in go.mod are processed when transitory flag is not set #367

Open
BartBucknill opened this issue Mar 3, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@BartBucknill
Copy link

Context: If Go dependencies do not list all of their dependencies in their own go.mod files, these transitive dependencies are included in the top level project go.mod file. They can be identified by the comment // indirect. See go modules reference.

Expected Behaviour: When running vet scan without passing the --transitive flag, I expect to scan only direct dependencies that I have explicitly imported. I should not see any dependencies from my go.mod which are commented with // indirect.

Actual Behaviour: The indirect dependencies are included in the scan.

@abhisek
Copy link
Member

abhisek commented Mar 3, 2025

Thanks for the clear and concise bug report @BartBucknill Adding to backlog for investigation

@abhisek abhisek added the bug Something isn't working label Mar 3, 2025
@abhisek
Copy link
Member

abhisek commented Mar 4, 2025

@OmkarPh Can you please do an analysis of this issue and share your findings? Since we use osv-scanner lockfile package for parsing go.mod files, I think we have to explore there if it differentiates between direct and transitive dependencies

@abhisek
Copy link
Member

abhisek commented Mar 6, 2025

We are adding support for dependency usage analysis for Go. Once #370 is merged, we should have a possible workaround for this issue.

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

No branches or pull requests

3 participants