Support XGoPackage marker alongside legacy GopPackage#2474
Conversation
This change enables XGo packages to use either GopPackage or XGoPackage as the marker constant for enabling XGo-specific transformations. Changes: - Update isGopPackage() to accept both GopPackage and XGoPackage markers - Update outline builder to filter out both markers from public constants - Add regression tests for XGoPackage marker This maintains backward compatibility while aligning with the XGo rebranding. Fixes #2473 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: xgopilot <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2474 +/- ##
=======================================
Coverage 93.33% 93.33%
=======================================
Files 34 34
Lines 11608 11608
=======================================
Hits 10834 10834
Misses 609 609
Partials 165 165 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@codex please take a look at this one. /gemini you too. |
|
Thanks for tagging me, @aofei! I've reviewed the changes in this pull request. The modifications to Overall, the changes are clear, concise, and well-tested. This looks good to merge! |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. |
doc/z_gop.go
Outdated
| xgoPackage = "XGoPackage" | ||
| ) | ||
|
|
||
| func isGopPackage(in *doc.Package) bool { |
There was a problem hiding this comment.
✅ Completed: Renamed isGopPackage to isXGoPackage
Successfully renamed the function and all its usages across the codebase:
Files modified:
doc/z_gop.go:32- renamed function definitiondoc/z_transform.go:251- renamed function calldoc/z_test.go:54-56- renamed test functionTestIsXGoPackageand calls
Verification:
- ✓ All files formatted with
go fmt - ✓ All tests pass (6/6 subtests in
TestFromTestdata, includingTestIsXGoPackage) - ✓ Changes committed and pushed to branch
Commit: 9d2095d4
- Renamed function definition in doc/z_gop.go - Updated function call in doc/z_transform.go - Updated test function and calls in doc/z_test.go Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: xushiwei <[email protected]>
Summary
This PR enables XGo packages to use either
GopPackageorXGoPackageas the marker constant for enabling XGo-specific transformations (e.g., overload processing).Changes
XGoPackageconstant and updatedisGopPackage()function to check for bothGopPackageandXGoPackagemarkersGopPackageandXGoPackagefrom the outlineXGoPackagemarker:xgoOverloadFn/: Tests function overload withXGoPackagemarkerxgoOverloadMethod/: Tests method overload withXGoPackagemarkerTesting
All existing tests pass, including the new test cases that verify the
XGoPackagemarker works equivalently toGopPackage:go test ./doc -vBackward Compatibility
This change maintains full backward compatibility:
GopPackagecontinue to work without modificationXGoPackageto align with the XGo brandingFixes #2473
Generated with codeagent