Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Breakdown of recursiveScan function: #497
initializeReport
function to initialize and configure themalcontent.Report
object.sync.Once
to ensure that a match (or miss) is processed only once, I CreatedsetMatchHandling
function to do that, basically in this :Only the first goroutine to send a result to this channel succeeds due to the buffered capacity of 1.
matchChan := make(chan matchResult, 1)
context.WithCancel
is used to signal all concurrent goroutines to stop further processing once a match is found.Let me know your thoughts on this @tstromberg
the logic for handling OCI image extraction (including the
imageURI
andociExtractPath
variables) moved into the helper functionprepareScanPath
.The call to
findFilesRecursively
is now encapsulated withinprocessPaths
. This function is responsible for finding files and managing their subsequent processing.Concurrency Handling logic moved to
processWithConcurrency
File-specific processing logic into a separate function (
processSingleFile
)storeFileReport
to store individual file reports andstoreArchiveReports
For storing multiple file reports from a sync.Map