-
Notifications
You must be signed in to change notification settings - Fork 212
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
Fix uint to format in decimal #199
Conversation
Thanks for the PR. I feel like we should always use decimal except for |
@dsnet Thanks for the review! Lines 132 to 147 in 049b73f
This seems to be the case when it is Line 73 in 049b73f
Line 87 in 049b73f
Should I format in hex only for |
Deleted PkgPath condition. If it is uint8 which is an alias of byte, format it to hex.
Added isSlice as an argument of FormatValue. If the value is uint8 and isSlice is true, FormatValue formats the value in hex.
@dsnet Hello! |
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.
Overall looks good. Minor nits.
cmp/report_compare.go
Outdated
@@ -81,14 +81,20 @@ func (opts formatOptions) FormatDiff(v *valueNode) textNode { | |||
return opts.FormatDiffSlice(v) | |||
} | |||
|
|||
var isSlice bool | |||
if v.parent != nil && |
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.
(Stye-nit): Keep conditional as single line.
cmp/report_compare.go
Outdated
@@ -81,14 +81,20 @@ func (opts formatOptions) FormatDiff(v *valueNode) textNode { | |||
return opts.FormatDiffSlice(v) | |||
} | |||
|
|||
var isSlice bool |
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.
Perhaps call this withinSlice
instead (here and elsewhere)? Since we're usually looking at this variable from the perspective of the child.
@dsnet Thank you for the review! |
Thanks! |
Ooops. Forgot to merge it. |
Since byte is an alias for uint8, format it in hex.
Fixes #185.