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

Use string formatting for slice of bytes #294

Merged
merged 1 commit into from
Apr 25, 2022
Merged

Conversation

dsnet
Copy link
Collaborator

@dsnet dsnet commented Apr 24, 2022

If a slice of bytes is mostly text, format them as text
instead of as []byte literal with hexadecimal digits.

Avoid always printing the type. This is technically invalid Go code,
but is unnecessary in many cases since the type is inferred
from the parent concrete type.

Fixes #272

@dsnet dsnet requested a review from neild April 24, 2022 00:44
@dsnet dsnet force-pushed the dsnet/slice-of-bytes branch 3 times, most recently from 8877ab0 to ddd88c9 Compare April 24, 2022 07:25
If a slice of bytes is mostly text, format them as text
instead of as []byte literal with hexadecimal digits.

Avoid always printing the type. This is technically invalid Go code,
but is unnecessary in many cases since the type is inferred
from the parent concrete type.

Fixes #272
@dsnet dsnet merged commit 71220fc into master Apr 25, 2022
@dsnet dsnet deleted the dsnet/slice-of-bytes branch April 25, 2022 16:32
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.

improve diff for []byte values
2 participants