Skip to content

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

Closed
@cagedmantis

Description

@cagedmantis

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.

Remaining instances of SetFinalizer (outside of runtime):

  • crypto/internal/boring: no longer supported. No use in updating.
  • crypto/tls: CL 664275
  • go/parser/testdata: test only change. Not worth modifying.
  • internal/types/testdata/check: test only change. Not worth modifying.
  • internal/poll: CL 671441
  • net: CL 638557 adds TODOs
  • os/exec (Current code relies on object resurrection)
  • reflect: test only change. Made easy modifications where possible CL 667595
  • syscall/js (Current code relies on object resurrection)
  • weak (intentionally used in test)

@mknyszek

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions