Search Apps Documentation Source Content File Folder Download Copy Actions Download

counter.gno

0.21 Kb ยท 16 lines
 1package staker
 2
 3type Counter struct {
 4	id int64
 5}
 6
 7func NewCounter() *Counter {
 8	return &Counter{id: 0}
 9}
10
11func (c *Counter) Get() int64 { return c.id }
12
13func (c *Counter) Next() int64 {
14	c.id++
15	return c.id
16}