diff --git a/counter.go b/counter.go index 608738c..980e21f 100644 --- a/counter.go +++ b/counter.go @@ -14,7 +14,7 @@ type Counter interface { // GetOrRegisterCounter returns an existing Counter or constructs and registers // a new StandardCounter. func GetOrRegisterCounter(name string, r Registry) Counter { - if nil == r { + if r == nil { r = DefaultRegistry } return r.GetOrRegister(name, NewCounter).(Counter) @@ -40,7 +40,7 @@ func NewCounter() Counter { // CounterSnapshot is a read-only copy of another Counter. type CounterSnapshot struct { - count int64 + count int64 } // Clear panics. @@ -85,7 +85,7 @@ func (NilCounter) Snapshot() Counter { return NilCounter{} } // StandardCounter is the standard implementation of a Counter and uses the // sync/atomic package to manage a single int64 value. type StandardCounter struct { - count atomic.Int64 + count atomic.Int64 } // Clear sets the counter to zero. @@ -111,6 +111,6 @@ func (c *StandardCounter) Inc(i int64) { // Snapshot returns a read-only copy of the counter. func (c *StandardCounter) Snapshot() Counter { return CounterSnapshot{ - count: c.Count(), + count: c.Count(), } } diff --git a/gauge.go b/gauge.go index 2a41d4c..0b75ea0 100644 --- a/gauge.go +++ b/gauge.go @@ -56,7 +56,7 @@ func NewRegisteredFunctionalGauge(name string, r Registry, f func() int64) Gauge // GaugeSnapshot is a read-only copy of another Gauge. type GaugeSnapshot struct { - value int64 + value int64 } // Snapshot returns the snapshot. @@ -85,13 +85,13 @@ func (NilGauge) Value() int64 { return 0 } // StandardGauge is the standard implementation of a Gauge and uses the // sync/atomic package to manage a single int64 value. type StandardGauge struct { - value atomic.Int64 + value atomic.Int64 } // Snapshot returns a read-only copy of the gauge. func (g *StandardGauge) Snapshot() Gauge { return GaugeSnapshot{ - value: g.Value(), + value: g.Value(), } } @@ -107,7 +107,7 @@ func (g *StandardGauge) Value() int64 { // FunctionalGauge returns value from given function type FunctionalGauge struct { - value func() int64 + value func() int64 } // Value returns the gauge's current value. @@ -118,7 +118,7 @@ func (g FunctionalGauge) Value() int64 { // Snapshot returns the snapshot. func (g FunctionalGauge) Snapshot() Gauge { return &GaugeSnapshot{ - value: g.Value(), + value: g.Value(), } }