gauge: fix unaligned 64-bit atomic operation panic on 32-bit architectures

This commit is contained in:
hagen1778 2023-12-22 15:54:57 +01:00
parent fa3e54236d
commit 49f6df7219
No known key found for this signature in database
GPG Key ID: 3BF75F3741CA9640

View File

@ -28,11 +28,11 @@ func NewGauge(name string, f func() float64) *Gauge {
// Gauge is a float64 gauge.
type Gauge struct {
// f is a callback, which is called for returning the gauge value.
f func() float64
// valueBits contains uint64 representation of float64 passed to Gauge.Set.
valueBits uint64
// f is a callback, which is called for returning the gauge value.
f func() float64
}
// Get returns the current value for g.