Type safety with "int", improved err handling and toolset addition nit #5
shivavishaal66215
started this conversation in
General
Replies: 1 comment
-
ack we will get back // @KarthikBoddeda @ChiragChiranjib |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Type Safety
int
usageint
as a type has been used in quite a few places in code (includingamount
handling).int
is platform dependent, this usage could lead to inconsistent behaviour or unexpected truncations .int32
orint64
will offer consistent behaviour.float64
toint
conversionsfloat64
toint
- these have to be updated for safety since there's an overflow riskError handling improvements
Current structure
Slightly better error handling
Example
amount
¤cy
.currency
problem until I fixamount
problem.Toolset Addition
Current:
Slightly better (D.R.Y.)
And, looks like all toolsets are enabled by default if none are explicitly enabled. Although there's nothing particularly wrong with this, it's human nature to assume nothing will be enabled if I'm not enabling anything. 🤔
Beta Was this translation helpful? Give feedback.
All reactions