package
Version:
v0.0.0-...-bb56650
Opens a new window with list of versions in this module.
Published: Feb 20, 2024
License: MIT
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.
It is safe to call this function multiple times.
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.