-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add float support to sleep() #498
Add float support to sleep() #498
Conversation
@st0012 I couldn't find any existing UT for this method, so I haven't added any (I'm not sure if there is a reason for it). |
Codecov Report
@@ Coverage Diff @@
## master #498 +/- ##
==========================================
- Coverage 83.45% 83.35% -0.11%
==========================================
Files 52 52
Lines 9123 9134 +11
==========================================
Hits 7614 7614
- Misses 1273 1284 +11
Partials 236 236
Continue to review full report at Codecov.
|
cca4526
to
d077a16
Compare
@saveriomiroddi I'd merge this once the coverage issue is fixed |
👍 |
Also improved the error handling, that would otherwise panic when not receiving the expected data type.
7ab3511
to
8ee02ad
Compare
@saveriomiroddi Can you take a look at this CI failure? I think it's because I clicked on update branch but I have no right to write your fork. |
vm/class.go
Outdated
float, ok := args[0].(*FloatObject) | ||
|
||
if ok { | ||
nanoseconds := int64(float.value * 1000000000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this number be set as a constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, there may be a more idiomatic way to express that. Hold on, I will check if I can improve it.
There you go, I've found a more expressive way for that statement. |
Add float support, and also improve the error handling.