-
Notifications
You must be signed in to change notification settings - Fork 398
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
pkg/acpi: lift loop condition and remove Sprintf #2851
Conversation
Signed-off-by: Siarhiej Siemianczuk <pdp.eleven11@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2851 +/- ##
=======================================
Coverage 75.69% 75.69%
=======================================
Files 425 425
Lines 42855 42853 -2
=======================================
- Hits 32438 32437 -1
+ Misses 10417 10416 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
see my question, I've started doing silly things like this go make sure it will work, but there has to be a better way to do this
var b [4]byte
var data []byte
bytes.NewBuffer(data).Read(b[:])
fmt.Printf("%q\n", string(b[:]))
kinda gross, but safe. is there not some package that does this? I've looked in some of the generic packages but not found it yet. But .. it ought to exist.
still, we've had this package for years, but still ...
What the difference with this snippet: data := make([]byte, 4)
fmt.Printf("%q\n", string(data[:])) We will got "\x00\x00\x00\x00" in both cases? |
The only difference: try it with |
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.
it's a google tradition in a PR to ask you to fix stuff somebody else wrote wrong :-)
No description provided.