Skip to content

fix: resolve gosec lint failures (G703, G117, G704) - #1985

Merged
sajayantony merged 1 commit into
oras-project:mainfrom
TerryHowe:fix-gosec-lint
Mar 4, 2026
Merged

sajayantony merged 1 commit into
oras-project:mainfrom
TerryHowe:fix-gosec-lint

Conversation

@TerryHowe

Copy link
Copy Markdown
Member

Summary

  • Remove unnecessary os.Remove in discover_test.go since t.TempDir() auto-cleans (G703)
  • Add nolint directive for Secret field in Remote struct — it's a CLI option, not a hardcoded secret (G117)
  • Add nolint directives for client.Do(req) calls in certificate_test.go — URLs come from local httptest.Server (G704)

Resolves #1984

Signed-off-by: Terry Howe [email protected]

- Remove unnecessary os.Remove in discover_test.go since t.TempDir()
  auto-cleans (G703)
- Add nolint directive for Secret field in Remote struct (G117)
- Add nolint directives for test httptest.Server client.Do calls (G704)

Signed-off-by: Terry Howe <[email protected]>
@codecov

codecov Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.18%. Comparing base (86d6d51) to head (6e833ee).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1985      +/-   ##
==========================================
+ Coverage   87.14%   87.18%   +0.03%     
==========================================
  Files         143      143              
  Lines        5539     5539              
==========================================
+ Hits         4827     4829       +2     
+ Misses        425      423       -2     
  Partials      287      287              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sabre1041 sabre1041 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sajayantony
sajayantony merged commit 7da9b0c into oras-project:main Mar 4, 2026
9 checks passed
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.

Fix gosec lint failures (G703, G117, G704)

3 participants