aboutsummaryrefslogtreecommitdiff
path: root/var.go
diff options
context:
space:
mode:
authorChris Wendt <chrismwendt@gmail.com>2022-06-08 03:27:33 -0600
committerChris Wendt <chrismwendt@gmail.com>2022-06-08 03:27:33 -0600
commite6ac933d42b3b4a8ffd891b205ba48f0c1e278a4 (patch)
treee103d0d81145c087011846af75aac7d328b917c1 /var.go
parentAtomicSet generic value (diff)
downloadstm-e6ac933d42b3b4a8ffd891b205ba48f0c1e278a4.tar.gz
stm-e6ac933d42b3b4a8ffd891b205ba48f0c1e278a4.tar.xz
replace "interface{}" with "any"
Diffstat (limited to 'var.go')
-rw-r--r--var.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/var.go b/var.go
index 2354d96..ec6a81e 100644
--- a/var.go
+++ b/var.go
@@ -25,7 +25,7 @@ func (v *Var[T]) getLock() *sync.Mutex {
return &v.mu
}
-func (v *Var[T]) changeValue(new interface{}) {
+func (v *Var[T]) changeValue(new any) {
old := v.value.Load()
newVarValue := old.Set(new)
v.value.Store(newVarValue)
@@ -35,7 +35,7 @@ func (v *Var[T]) changeValue(new interface{}) {
}
func (v *Var[T]) wakeWatchers(new VarValue) {
- v.watchers.Range(func(k, _ interface{}) bool {
+ v.watchers.Range(func(k, _ any) bool {
tx := k.(*Tx)
// We have to lock here to ensure that the Tx is waiting before we signal it. Otherwise we
// could signal it before it goes to sleep and it will miss the notification.