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

runtime: use runtime.AddCleanup in the standard library #70907

Open
cagedmantis opened this issue Dec 18, 2024 · 4 comments
Open

runtime: use runtime.AddCleanup in the standard library #70907

cagedmantis opened this issue Dec 18, 2024 · 4 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@cagedmantis
Copy link
Contributor

AddCleanup has been added to the runtime (#67535). We should use runtime.AddCleanup instead of runtime.SetFinalizer in the standard library wherever it is possible.

@mknyszek

@cagedmantis cagedmantis added NeedsFix The path to resolution is known, but the work has not been done. compiler/runtime Issues related to the Go compiler and/or runtime. labels Dec 18, 2024
@cagedmantis cagedmantis added this to the Go1.25 milestone Dec 18, 2024
@cagedmantis cagedmantis self-assigned this Dec 18, 2024
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/638555 mentions this issue: os: use AddCleanup to close files

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/638557 mentions this issue: net: use runtime.AddCleanup instead of runtime.SetFinalizer

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/638556 mentions this issue: io: use runtime.AddCleanup instead of runtime.SetFinalizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

3 participants