1package staker
23type Counter struct{4 id int645}67// NewCounter creates a counter initialized before the first allocated identifier.8//9// Returns:10// - *Counter: counter whose current identifier is zero.11funcNewCounter()*Counter {12return&Counter{id:0}13}1415// Get returns the counter's current identifier without incrementing it.16//17// Returns:18// - int64: most recently allocated identifier, or zero for a new counter.19func(c *Counter)Get()int64{return c.id }2021// Next increments the counter and returns the newly allocated identifier.22//23// Returns:24// - int64: next identifier after incrementing the counter by one.25func(c *Counter)Next()int64{26 c.id++27return c.id
28}29