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

Print uint in decimal? #93

Open
ajitid opened this issue Apr 1, 2023 · 3 comments
Open

Print uint in decimal? #93

ajitid opened this issue Apr 1, 2023 · 3 comments

Comments

@ajitid
Copy link

ajitid commented Apr 1, 2023

Same request as google/go-cmp#185, where the conclusion was to print all unsigned integers in decimal form, except uint8 and uintptr which would be printed in hex (see this change).
I think diff should have the same support as well.

@ajitid
Copy link
Author

ajitid commented Apr 1, 2023

Unrelated: is there a way to print rune character instead of the Unicode number it maps to?

@kr
Copy link
Owner

kr commented Apr 1, 2023

print all unsigned integers in decimal form, except uint8 and uintptr which would be printed in hex

This seems reasonable to me!

@kr
Copy link
Owner

kr commented Apr 1, 2023

Unrelated: is there a way to print rune character instead of the Unicode number it maps to?

Type rune is an alias for int; there's no way for this package to distinguish them. Best idea I know of is to print both the decimal value and the character (if the character is printable) for all int values.

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

No branches or pull requests

2 participants