0
1
mirror of https://github.com/golang/go synced 2024-11-26 14:56:18 +00:00
go/api/next/67535.txt
Carlos Amedee 0531768b30 runtime: implement AddCleanup
This change introduces AddCleanup to the runtime package. AddCleanup attaches
a cleanup function to an pointer to an object.

The Stop method on Cleanups will be implemented in a followup CL.

AddCleanup is intended to be an incremental improvement over
SetFinalizer and will result in SetFinalizer being deprecated.

For #67535

Change-Id: I99645152e3fdcee85fcf42a4f312c6917e8aecb1
Reviewed-on: https://go-review.googlesource.com/c/go/+/627695
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
2024-11-16 03:26:04 +00:00

4 lines
179 B
Plaintext

pkg runtime, func AddCleanup[$0 interface{}, $1 interface{}](*$0, func($1), $1) Cleanup #67535
pkg runtime, method (Cleanup) Stop() #67535
pkg runtime, type Cleanup struct #67535