Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@raphael
Copy link
Member

@raphael raphael commented Jul 25, 2025

This fix resolves the issue where ConvertTo/CreateFrom functions were generated in the wrong directory when types have Meta("struct:pkg:path") metadata.

Changes:

  • Replace ConvertFile with ConvertFiles to support multi-package generation
  • Group conversions by target package path using UserTypeLocation
  • Add SamePackageConversion flag to AttributeContext for proper type references
  • Add comprehensive test coverage for multi-package conversion scenarios
  • Update service generator to use new ConvertFiles function
  • Add branch naming conventions to CLAUDE.md

The implementation follows the existing multi-package pattern used in service.go and ensures that conversion functions are generated in the correct package directory while maintaining proper type qualification.

…pkg:path metadata

This fix resolves the issue where ConvertTo/CreateFrom functions were generated
in the wrong directory when types have Meta("struct:pkg:path") metadata.

Changes:
- Replace ConvertFile with ConvertFiles to support multi-package generation
- Group conversions by target package path using UserTypeLocation
- Add SamePackageConversion flag to AttributeContext for proper type references
- Add comprehensive test coverage for multi-package conversion scenarios
- Update service generator to use new ConvertFiles function
- Add branch naming conventions to CLAUDE.md

The implementation follows the existing multi-package pattern used in service.go
and ensures that conversion functions are generated in the correct package
directory while maintaining proper type qualification.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
raphael and others added 2 commits July 24, 2025 22:42
- Replace manual string slicing with filepath.Dir() for cross-platform compatibility
- Add filepath.FromSlash() in tests to normalize path separators
- Fixes GitHub Actions Windows test failure in TestConvertFiles

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@raphael raphael merged commit b92c333 into v3 Jul 25, 2025
9 checks passed
@raphael raphael deleted the fix/conversion-files-per-package-issue-3745 branch July 25, 2025 05:58
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.

1 participant