-
Notifications
You must be signed in to change notification settings - Fork 29
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
Gosum support #475
base: main
Are you sure you want to change the base?
Gosum support #475
Conversation
edit: better parsing of the go.sum
doc: added documentation of extractFromSum
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
// extractFromSum extracts dependencies from the go.sum file. | ||
// | ||
// Note: This function may produce false positives, as the go.sum file might be outdated. | ||
func extractFromSum(input *filesystem.ScanInput) ([]*extractor.Inventory, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean go.sum files only exist when a go.mod file is present, no matter what go version?
log.Warnf("Error reading go.sum file: %s", err) | ||
} else { | ||
for _, p := range sumPackages { | ||
packages[mapKey{name: p.Name, version: p.Version}] = p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this will overwrite packages from go.mod, right? I think we don't want to do this deduplication. If we skip it we can also add go.sum in FileRequired and replace Extract with a "if" between extractGoMod and extractGoSum. WDYT?
This PR enables scalibr to search for indirect dependencies inside the
go.sum
if the go.mod's golang version is < 1.17.This feature is necessary since before 1.17 every indirect dependency was only present in the
go.sum
file.