Skip to content

fix: skip hashes for modules without a directory#747

Draft
Eljees wants to merge 1 commit into
CycloneDX:mainfrom
Eljees:agent/skip-empty-module-hash
Draft

fix: skip hashes for modules without a directory#747
Eljees wants to merge 1 commit into
CycloneDX:mainfrom
Eljees:agent/skip-empty-module-hash

Conversation

@Eljees

@Eljees Eljees commented Jul 19, 2026

Copy link
Copy Markdown

Fixes #743

Summary

  • skip module hash calculation when Go reports a pseudo-module without a filesystem directory
  • add regression coverage for command-line-arguments@go1.26.3 with an empty Dir

This mirrors the existing license-detection guard for modules that are not present on disk and prevents HashDir("", ...) from walking the working directory.

Test

  • go test ./internal/sbom/convert/module (Go 1.26.3)

Signed-off-by: Eljees <yurytumanov.r@yandex.ru>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

cyclonedx-gomod fails on Go 1.26.3: tries to hash command-line-arguments@go1.26.x pseudo-module

1 participant