feat(go): Add Go stdlib extraction tool for registry generation (PR-21)#548
Open
shivasurya wants to merge 1 commit intoshiva/go-stdlib-support-pr01from
Open
feat(go): Add Go stdlib extraction tool for registry generation (PR-21)#548shivasurya wants to merge 1 commit intoshiva/go-stdlib-support-pr01from
shivasurya wants to merge 1 commit intoshiva/go-stdlib-support-pr01from
Conversation
- Add tools/internal/goextract package with Extractor struct for walking
GOROOT/src and extracting full API surface of stdlib packages
- Extract functions (with generics, variadic, methods), types (struct,
interface, alias), constants (iota detection), and variables
- Generate per-package JSON files ({pkg}_stdlib.json) and manifest.json
with SHA256 checksums and aggregate statistics
- Add CLI entry point tools/generate_go_stdlib_registry.go with
--go-version, --output-dir, and --goroot flags
- Achieve 100% test coverage with unit and integration tests (186 packages
extracted from Go 1.26 stdlib in integration test)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## shiva/go-stdlib-support-pr01 #548 +/- ##
================================================================
+ Coverage 82.68% 83.14% +0.45%
================================================================
Files 140 141 +1
Lines 17143 17610 +467
================================================================
+ Hits 14174 14641 +467
Misses 2427 2427
Partials 542 542 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
tools/internal/goextractpackage implementingExtractorfor walking$GOROOT/srcand extracting the full exported API surface of Go stdlib packages viago/parserandgo/ast{pkg}_stdlib.json) andmanifest.jsonwith SHA256 checksums and aggregate statistics (186 packages from Go 1.26 stdlib)tools/generate_go_stdlib_registry.gowith--go-version,--output-dir, and--gorootflagsTest plan
go build ./...passes with zero errorsgolangci-lint run ./...reports 0 issuesgo test ./tools/internal/goextract/— 100% coverage, all tests passfmt.Printlnvariadic,slices.Sortgeneric,os.Stdinvariablego test ./...— all 29 packages passimport_path,is_variadic,is_generic, etc.) matching core types from PR-01🤖 Generated with Claude Code