gofr
gofr copied to clipboard
[WIP] REFACTOR: parseRange func & error messages
Closes: #1000
Description:
Refactor parseRange
Function
This PR refactors the parseRange
function in the cron
file to enhance error handling and improve parsing logic. The changes include:
-
Updated Error Handling:
- Enhanced error messages for
errOutOfRange
anderrParsing
to provide clearer and more accurate information.
- Enhanced error messages for
-
Refactored Functions:
-
parseRange
: Improved error handling and parsing logic for ranges and individual values. -
processPart
: Refined handling of both value and range parts. -
handleValue
: Enhanced error reporting for out-of-range values. -
handleRange
: Added checks for invalid range formats and adjusted error messages.
-
-
Added Unit Tests:
- Comprehensive tests for
processPart
,handleValue
, andhandleRange
to cover various edge cases and validate the refactored logic.
- Comprehensive tests for
Checklist:
- [x] I have formatted my code using
goimport
andgolangci-lint
. - [x] All new code is covered by unit tests.
- [x] This PR does not decrease the overall code coverage.
- [ ] I have reviewed the code comments and documentation for clarity.
Thank you for your contribution!