You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✅ Reduced Code Duplication:
1. Repository Layer: Created scanProductRows() helper function in internal/products/repository.go:170 that eliminates ~30 lines of duplicated row scanning logic between FindAll() and Search() methods
2. Test Helpers: Added generic mockReturn[T]() helper function to reduce repetitive mock handling patterns
3. Vendor Sync: Fixed vendor directory inconsistency that was causing build failures
✅ Key Changes Made:
- Repository refactoring: Both FindAll() and Search() now use shared scanProductRows() helper
- Test improvements: Reduced mock boilerplate with generic helper function
- CI/CD fixed: Updated GitHub Actions to use -mod=readonly flag
✅ Impact:
- Reduced duplication: Most significant duplication (26.9% in repository.go) has been eliminated
- Maintainability: Shared logic is now centralized and easier to maintain
- Test stability: All 156+ test cases continue to pass
- CI/CD reliability: Both Go workflow and build process now work correctly
0 commit comments