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

Rename ByteSliceMode to ByteSliceLaterFormatMode, etc #554

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

fxamacker
Copy link
Owner

This PR renamed ByteSliceMode to ByteSliceLaterFormatMode and also renamed related options.

For context:

// ByteSliceLaterFormatMode specifies which later format conversion hint (CBOR tag 21-23)
// to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
// always encode unmodified bytes from the byte slice and just wrap it within
// CBOR tag 21, 22, or 23 if specified.
// See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.

Also considered using ByteSliceLaterEncodingMode but the word "format" (i.e. encoding format) is probably less ambiguous for people unfamiliar with RFC 8949 Section 3.4.5.2.

Also renamed related options to be consistent.
@fxamacker fxamacker added the improvement improvement that does not add new feature label Jun 10, 2024
@fxamacker fxamacker self-assigned this Jun 10, 2024
@fxamacker fxamacker changed the base branch from fxamacker/add-userbufferencmode-interface to master June 10, 2024 02:31
@fxamacker
Copy link
Owner Author

@benluddy @x448 PTAL 🙏

Comment on lines +811 to +812
byteSliceLaterFormat ByteSliceLaterFormatMode
byteSliceLaterEncodingTag uint64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, should byteSliceLaterEncodingTag be renamed to byteSliceLaterFormatTag?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encoding tag makes more sense to me because it is about CBOR tag number to be encoding.

Comment on lines -406 to +411
// ByteSliceMode specifies how to encode slices of bytes.
type ByteSliceMode int
// ByteSliceLaterFormatMode specifies which later format conversion hint (CBOR tag 21-23)
// to include (if any) when encoding Go byte slice to CBOR byte string. The encoder will
// always encode unmodified bytes from the byte slice and just wrap it within
// CBOR tag 21, 22, or 23 if specified.
// See "Expected Later Encoding for CBOR-to-JSON Converters" in RFC 8949 Section 3.4.5.2.
type ByteSliceLaterFormatMode int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helped. Thanks for adding more comments.

@fxamacker fxamacker merged commit 878cfef into master Jun 10, 2024
18 checks passed
@fxamacker fxamacker deleted the fxamacker/rename-bytestringmode branch September 7, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement improvement that does not add new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants