Reduce cyclomatic complexity in handler.match() and 100% test coverage for handlers.go - #222
steindvart wants to merge 6 commits into
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #222 +/- ##
==========================================
+ Coverage 45.30% 47.85% +2.54%
==========================================
Files 29 29
Lines 2355 2123 -232
==========================================
- Hits 1067 1016 -51
+ Misses 1241 1063 -178
+ Partials 47 44 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Incorporate the handler decomposition and tests from PR #222. Use success flags for update and command extraction, avoid allocations for absent update data, and reject invalid command bounds without overflow or empty-pattern matches. Co-authored-by: Ivan Kalashnikov <ivank.public@gmail.com>
|
Implemented in #304, which has been merged into main. The handler decomposition and tests from this PR were included, with additional command-boundary validation and allocation-free success flags. Your contribution is credited in the merged commit with a Co-authored-by trailer. Thank you for the refactoring and tests! |
Problem
Solution - what PR does
(h handler) match(update *models.Update). To reduce cyclomatic complexity, and improve testability.Now, for
handlers.gofile, the following indicators apply:Previous:
handlers.gofile.