Skip to content

feat(go): Add Go stdlib remote registry loader with lazy caching (PR-03)#549

Merged
shivasurya merged 1 commit intomainfrom
shiva/go-stdlib-support-pr03
Feb 25, 2026
Merged

feat(go): Add Go stdlib remote registry loader with lazy caching (PR-03)#549
shivasurya merged 1 commit intomainfrom
shiva/go-stdlib-support-pr03

Conversation

@shivasurya
Copy link
Owner

Summary

  • Add GoStdlibRegistryRemote implementing the core.GoStdlibLoader interface
  • Lazy per-package loading: only download packages when first accessed
  • SHA256 checksum verification of each package against the manifest
  • Thread-safe double-check locking (sync.RWMutex) prevents duplicate downloads under concurrency
  • 30s HTTP timeout; versioned CDN URL pattern ({baseURL}/go{version}/stdlib/v1/)
  • Helper methods: CacheSize, ClearCache, IsManifestLoaded, GoVersion

Test plan

  • TestLoadManifest_* — success, HTTP error, network error, invalid JSON, bad URL, body read error
  • TestGetPackage_* — cache hit (fast path), download, not found, HTTP error, network error, invalid JSON, checksum mismatch, checksum skip, body read error
  • TestFetchPackageLocked_DoubleCheckCacheHit — deterministic double-check path coverage
  • TestValidateStdlibImport_*, TestGetFunction_*, TestGetType_*, TestPackageCount_*
  • TestConcurrentGetPackage — race detector clean
  • 100% coverage on go_stdlib_remote.go, 0 lint issues, all 20 packages pass

Stacked on

PR-21 (shiva/go-stdlib-support-pr02) — Go stdlib extraction tool

🤖 Generated with Claude Code

@shivasurya shivasurya added enhancement New feature or request go Pull requests that update go code labels Feb 21, 2026
@shivasurya shivasurya self-assigned this Feb 21, 2026
@safedep
Copy link

safedep bot commented Feb 21, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

No dependency changes detected. Nothing to scan.

This report is generated by SafeDep Github App

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.22%. Comparing base (e8dac45) to head (4ba4dff).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #549      +/-   ##
==========================================
+ Coverage   83.09%   83.22%   +0.12%     
==========================================
  Files         141      142       +1     
  Lines       17531    17660     +129     
==========================================
+ Hits        14568    14697     +129     
  Misses       2422     2422              
  Partials      541      541              

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivasurya shivasurya changed the title feat(go): Add Go stdlib remote registry loader with lazy caching (PR-22) feat(go): Add Go stdlib remote registry loader with lazy caching (PR-03) Feb 25, 2026
Copy link
Owner Author

shivasurya commented Feb 25, 2026

Merge activity

  • Feb 25, 3:17 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 25, 3:21 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 25, 3:21 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from shiva/go-stdlib-support-pr02 to graphite-base/549 February 25, 2026 03:18
@shivasurya shivasurya changed the base branch from graphite-base/549 to main February 25, 2026 03:19
- Implement GoStdlibRegistryRemote satisfying core.GoStdlibLoader interface
- Lazy per-package loading with SHA256 checksum verification against manifest
- Double-check locking (RWMutex) to prevent duplicate downloads under concurrency
- 30s HTTP timeout; manifest and packages fetched from versioned CDN URLs
- 100% test coverage; 0 lint issues

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shivasurya shivasurya force-pushed the shiva/go-stdlib-support-pr03 branch from 39c0210 to 4ba4dff Compare February 25, 2026 03:20
@github-actions
Copy link

Code Pathfinder Security Scan

Pass Critical High Medium Low Info

No security issues detected.

Metric Value
Files Scanned 2
Rules 38

Powered by Code Pathfinder

@shivasurya shivasurya merged commit 81412bf into main Feb 25, 2026
5 checks passed
@shivasurya shivasurya deleted the shiva/go-stdlib-support-pr03 branch February 25, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant