Skip to content

Commit 8b66021

Browse files
author
Mike Heffner
authored
Must read value with atomic (#260)
1 parent 36ed932 commit 8b66021

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

metriks/gauge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (g *PersistentGauge) start(ctx context.Context) {
6464
g.wg.Done()
6565
return
6666
case <-g.ticker.C:
67-
g.report(g.value)
67+
g.report(atomic.LoadInt32(&g.value))
6868
}
6969
}
7070
}

0 commit comments

Comments
 (0)