-
-
Notifications
You must be signed in to change notification settings - Fork 850
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce safe integer conversion with error handling (#812)
- Add `errors` and `math` packages to imports - Introduce `safeIntToInt32` function to safely convert `int` to `int32` with error handling for out-of-range values - Replace direct `int32` conversion with `safeIntToInt32` in `Send` function - Add unit tests for `safeIntToInt32` function with various test cases including valid, overflow, and underflow scenarios Signed-off-by: appleboy <[email protected]>
- Loading branch information
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters