Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8977 +/- ##
==========================================
+ Coverage 82.93% 83.10% +0.16%
==========================================
Files 411 411
Lines 32704 32719 +15
==========================================
+ Hits 27124 27192 +68
+ Misses 4179 4146 -33
+ Partials 1401 1381 -20
🚀 New features to boost your workflow:
|
Works just like Go's slice slicing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have a
CodecV2that gives me amem.BufferSlice(i.e. exposes what it gets from gRPC directly). I need to get anothermem.BufferSlicefrom it that is a subslice. In some scenarios I need to slice the first and/or the last buffer to get only the subset of data. Hence, having aSlice()method on theBuffertype would be really useful.Another use case: I want to use
BufferSlice.Readerand implement aPeek()(or similar) to get aBufferSliceof the next N bytes. I don't want a[]byteor[][]byte, I'd like to return thisBufferSlicefrom a codecv2 and let gRPC free the buffers when it no longer needs them (i.e. I don't want to wrap those individual[]byteintoBufferSlices).RELEASE NOTES:
mem.Buffer.Slice()- new method to slice the buffer like a slice.