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

Stop using golang.org/x/net/context #1509

Merged
merged 1 commit into from
Feb 10, 2023
Merged

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Feb 9, 2023

As of Go >= 1.9, the implementation of the used parts of x/net/context just forwards to the standard library.

So, use the standard library directly, and avoid the x/net dependency entirely. This should save a tiny bit of space in users like Podman.

As of Go >= 1.9, the implementation of the used parts
of x/net/context just forwards to the standard library.

So, use the standard library directly, and avoid the x/net dependency entirely.
This should save a tiny bit of space in users like Podman.

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

rhatdan commented Feb 9, 2023

LGTM
Woohoo shrinkage.

@mtrmac
Copy link
Collaborator Author

mtrmac commented Feb 9, 2023

It’s like 30 kB of the object file, i.e much less in the whole binary… the big gains are elsewhere. I just noticed that we are actually linking this compatibility shim…

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM, nice!

@vrothberg vrothberg merged commit a01f71d into containers:main Feb 10, 2023
@mtrmac mtrmac deleted the context branch February 10, 2023 17:32
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

3 participants