package
Version:
v0.1.5
Opens a new window with list of versions in this module.
Published: Dec 12, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Var[T any] struct {
}
Var contains a variable of any type protected by a mutex
func New[T any](value T) *Var[T]
New creates a new Var with specified value
Zero creates a new Var with a zero value
func (v *Var[T]) Set(value T)
Set sets a value
func (v *Var[T]) Swap(value T) T
Swap sets a new value and returns the previous value
Source Files
¶
Click to show internal directories.
Click to hide internal directories.