-
Notifications
You must be signed in to change notification settings - Fork 326
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
Another way to drop raw bytes of the capture data #2186
Another way to drop raw bytes of the capture data #2186
Conversation
@ben-clayton Any suggestions about this CL? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the slow review.
I like this solution. Good stuff!
Please can you squash the top two CLs? Having the intermediate form appears to serve no purpose and just litters the git history.
gapis/capture/capture.go
Outdated
@@ -266,6 +267,32 @@ func (c *Capture) Export(ctx context.Context, w io.Writer) error { | |||
return e.encode(ctx) | |||
} | |||
|
|||
type Source interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs please.
gapis/capture/capture.go
Outdated
bytes.Reader | ||
} | ||
|
||
func (brc *blobReadCloser) Close() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Übernit: You can drop the brc *
bit of the receiver.
gapis/capture/capture.go
Outdated
} | ||
|
||
func (b *Blob) ReadCloser() (io.ReadCloser, error) { | ||
return &blobReadCloser{*bytes.NewReader(b.GetData())}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Übernit: Make bytes.Reader
field a pointer (*bytes.Reader
), you can drop the indirection stuff:
return blobReadCloser{bytes.NewReader(b.GetData())}, nil
e65364b
to
41cb2b7
Compare
Yep, I always squash and rebase for CLs. |
This is another approach to do the same thing as #2179