package utils import "sync/atomic" type Counter struct { value atomic.Int64 } func NewCounter() *Counter { return &Counter{} } func (c *Counter) Increment() { c.value.Add(1) } func (c *Counter) Get() int64 { return c.value.Load() } func (c *Counter) Reset() { c.value.Store(0) }