-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
adding binary to int conversion #1475
Conversation
package.go
Outdated
} else if x, err := strconv.ParseUint(valueExpr.Value[2:], 2, 64); err == nil { | ||
return x, nil | ||
} else { | ||
panic(err) |
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.
You shouldn't panic here.
You should return 0, nil
, and print the actual error.
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.
I thought the same but looking at hexadecimal and octects conversions that are below my code, I tried to keep the same standard
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 you please fix the other "standard" :)
Please also add unit tests for this change. |
@ldrazic, Any updates? |
@ubogdan I got stuck on the unit tests and left it there |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1475 +/- ##
==========================================
+ Coverage 83.76% 83.82% +0.05%
==========================================
Files 19 19
Lines 3752 3753 +1
==========================================
+ Hits 3143 3146 +3
+ Misses 521 520 -1
+ Partials 88 87 -1
☔ View full report in Codecov by Sentry. |
A same PR as #1593. |
Describe the PR
adding binary to int conversion
Relation issue
#1466
Additional context
All the context is in the issue