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

Don't use bytes.NewBuffer to read data #1572

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Apr 14, 2023

The documentation says

The new Buffer takes ownership of buf, and the
caller should not use buf after this call.

so use the more directly applicable, and simpler, bytes.Reader instead, to avoid this potentially risky use.

The documentation says
> The new Buffer takes ownership of buf, and the
> caller should not use buf after this call.

so use the more directly applicable, and simpler, bytes.Reader
instead, to avoid this potentially risky use.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Apr 16, 2023

LGTM

@rhatdan
Copy link
Member

rhatdan commented Apr 16, 2023

@nalind
Copy link
Member

nalind commented Apr 17, 2023

LGTM.

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

LGTM

@vrothberg vrothberg merged commit 5ffb3a7 into containers:main Apr 17, 2023
18 checks passed
@mtrmac mtrmac deleted the no-NewBuffer branch April 17, 2023 17:21
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.

None yet

5 participants