Skip to content

feat(go): Add Go stdlib extraction tool for registry generation (PR-02)#548

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

feat(go): Add Go stdlib extraction tool for registry generation (PR-02)#548
shivasurya merged 1 commit intomainfrom
shiva/go-stdlib-support-pr02

Conversation

@shivasurya
Copy link
Owner

Summary

  • Add tools/internal/goextract package implementing Extractor for walking $GOROOT/src and extracting the full exported API surface of Go stdlib packages via go/parser and go/ast
  • Extract functions (signatures, params, returns, generics, variadic, methods), types (struct/interface/alias with fields and methods), constants (iota detection), and package-level variables with docstrings and deprecation markers
  • Generate per-package JSON files ({pkg}_stdlib.json) and manifest.json with SHA256 checksums and aggregate statistics (186 packages from Go 1.26 stdlib)
  • Add CLI entry point tools/generate_go_stdlib_registry.go with --go-version, --output-dir, and --goroot flags
  • Achieve 100% test coverage with 40+ unit tests and integration tests against real Go 1.26 stdlib

Test plan

  • go build ./... passes with zero errors
  • golangci-lint run ./... reports 0 issues
  • go test ./tools/internal/goextract/ — 100% coverage, all tests pass
  • Integration test extracts 186 packages from Go 1.26 stdlib, verifies fmt.Println variadic, slices.Sort generic, os.Stdin variable
  • Full module test suite go test ./... — all 29 packages pass
  • JSON output uses snake_case keys (import_path, is_variadic, is_generic, etc.) matching core types from PR-01

🤖 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
@shivasurya shivasurya added enhancement New feature or request go Pull requests that update go code labels 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.09%. Comparing base (8fe4410) to head (10f5ae8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #548      +/-   ##
==========================================
+ Coverage   82.64%   83.09%   +0.45%     
==========================================
  Files         140      141       +1     
  Lines       17064    17531     +467     
==========================================
+ Hits        14103    14568     +465     
- Misses       2421     2422       +1     
- Partials      540      541       +1     

☔ 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 extraction tool for registry generation (PR-21) feat(go): Add Go stdlib extraction tool for registry generation (PR-02) 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:19 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 25, 3:19 AM UTC: @shivasurya merged this pull request with Graphite.

@shivasurya shivasurya changed the base branch from shiva/go-stdlib-support-pr01 to graphite-base/548 February 25, 2026 03:17
@shivasurya shivasurya changed the base branch from graphite-base/548 to main February 25, 2026 03:17
- 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>
@shivasurya shivasurya force-pushed the shiva/go-stdlib-support-pr02 branch from d0b0db7 to 10f5ae8 Compare February 25, 2026 03:18
@github-actions
Copy link

Code Pathfinder Security Scan

Pass Critical High Medium Low Info

No security issues detected.

Metric Value
Files Scanned 4
Rules 38

Powered by Code Pathfinder

@shivasurya shivasurya merged commit e8dac45 into main Feb 25, 2026
5 checks passed
@shivasurya shivasurya deleted the shiva/go-stdlib-support-pr02 branch February 25, 2026 03:19
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