package
Version:
v1.7.0
Opens a new window with list of versions in this module.
Published: Jul 31, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package resource provides utilities for tracking resource lifetimes.
Track tracks the lifetime of an object until Untrack is called on it.
Obj should a pointer to a struct with a field "token" of type *Token.
Untrack stops tracking the lifetime of an object.
Token should be a field of a tracked object.
The underlying type is not struct{} because (from the Go spec)
"Two distinct zero-size variables may have the same address in memory",
and they do.
NewToken returns a new Token.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.