quicvarint: implement function to peek the next varint#5502
quicvarint: implement function to peek the next varint#5502marten-seemann merged 1 commit intomasterfrom
Conversation
Add
|
There was a problem hiding this comment.
Pull request overview
This PR implements a Peek function for reading QUIC varints without consuming bytes from the input. The implementation introduces a new Peeker interface and provides comprehensive test coverage for all varint sizes and error conditions.
Key Changes:
- Added
Peekerinterface andPeekfunction to support non-consuming reads of QUIC varints - Implemented comprehensive tests covering all varint encodings (1, 2, 4, and 8 bytes) and error cases
- Fixed a minor documentation typo in the
NewWriterfunction comment
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| quicvarint/io.go | Defines the Peeker interface and implements the Peek function that reads QUIC varints without consuming bytes; also fixes a documentation typo in the NewWriter comment |
| quicvarint/io_test.go | Adds bufPeeker test helper and comprehensive test coverage for the Peek function, including success cases for all varint sizes and error cases for insufficient data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9c1abf3 to
79c807f
Compare
dc97a51 to
7678ff9
Compare
7678ff9 to
797b0c9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5502 +/- ##
==========================================
+ Coverage 84.03% 84.11% +0.08%
==========================================
Files 158 158
Lines 16280 16291 +11
==========================================
+ Hits 13680 13703 +23
+ Misses 1967 1958 -9
+ Partials 633 630 -3 ☔ View full report in Codecov by Sentry. |
797b0c9 to
13a591c
Compare
f170959 to
045da59
Compare
13a591c to
f5c271f
Compare
Peek doesn’t consume any more bytes than needed to parse the next QUIC varint.
f5c271f to
89050f6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Peek doesn’t consume any more bytes than needed to parse the next QUIC varint.
Peek doesn’t consume any more bytes than needed to parse the next QUIC varint.
Peek doesn’t consume any more bytes than needed to parse the next QUIC varint.
Depends on #5501.For #4405.