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

Turn this package into a wrapper for protobuf/encoding/protodelim #22

Merged
merged 1 commit into from Jan 12, 2024

Conversation

stapelberg
Copy link
Contributor

Since Go Protobuf v1.30.0, the protodelim package is available upstream.

The only notable API difference is that protodelim does not return the number of bytes read, which is why I added the countingReader type to pbutil/decode.go.

fixes #21


I’m creating this as a draft pull request because https://go-review.git.corp.google.com/c/protobuf/+/505555 needs to get merged and released before the tests pass (TestReadDelimitedPrematureHeader currently panics). Feel free to review already if you want — I don’t foresee any more changes other than a go.mod update.

@stapelberg
Copy link
Contributor Author

This PR is now ready for review (Go Protobuf v1.31.0 contains the fix we needed)

Copy link
Contributor Author

@stapelberg stapelberg left a comment

Choose a reason for hiding this comment

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

Updated to address your comment, and also bumped the commit date to today :)

pbutil/decode.go Show resolved Hide resolved
@matttproud
Copy link
Owner

Looks good. I think we can merge it pretty readily.

@stapelberg
Copy link
Contributor Author

Great stuff! Ready when you are :)

Copy link
Owner

@matttproud matttproud left a comment

Choose a reason for hiding this comment

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

The comments below are rather simple:

pbutil/decode.go Outdated Show resolved Hide resolved
pbutil/decode.go Outdated Show resolved Hide resolved
pbutil/decode.go Outdated Show resolved Hide resolved
pbutil/decode.go Outdated Show resolved Hide resolved
pbutil/decode.go Show resolved Hide resolved
pbutil/decode_test.go Outdated Show resolved Hide resolved
Since Go Protobuf v1.30.0, the protodelim package is available upstream.

The only notable API difference is that protodelim does not return the number of
bytes read, which is why I added the countingReader type to pbutil/decode.go.
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.

protodelim is now included in official Go implementation
2 participants