Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

ldrazic
Copy link

@ldrazic ldrazic commented Feb 23, 2023

Describe the PR
adding binary to int conversion

Relation issue
#1466

Additional context
All the context is in the issue

package.go Outdated
} else if x, err := strconv.ParseUint(valueExpr.Value[2:], 2, 64); err == nil {
return x, nil
} else {
panic(err)
Copy link
Contributor

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.

Copy link
Author

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

Copy link
Contributor

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" :)

@ubogdan
Copy link
Contributor

ubogdan commented Feb 23, 2023

Please also add unit tests for this change.

@ubogdan
Copy link
Contributor

ubogdan commented Mar 23, 2023

@ldrazic, Any updates?

@ldrazic
Copy link
Author

ldrazic commented Mar 23, 2023

@ubogdan I got stuck on the unit tests and left it there

@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Patch coverage: 72.72% and project coverage change: +0.05 🎉

Comparison is base (e73a0d0) 83.76% compared to head (d5ee8fd) 83.82%.

❗ Current head d5ee8fd differs from pull request most recent head 52a78c8. Consider uploading reports for the commit 52a78c8 to get more accurate results

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     
Impacted Files Coverage Δ
package.go 75.47% <72.72%> (+2.13%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sdghchj
Copy link
Member

sdghchj commented Jul 18, 2023

A same PR as #1593.

@sdghchj sdghchj closed this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants