Search Apps Documentation Source Content File Folder Download Copy Actions Download

counter.gno

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