Search Apps Documentation Source Content File Folder Download Copy Actions Download

counter.gno

0.22 Kb · 15 lines
 1package counter
 2
 3import "strconv"
 4
 5type state struct{ count int }
 6
 7func (s *state) inc() { s.count++ }
 8
 9var counter state
10
11func Increment() { counter.inc() }
12
13func Render(_ string) string {
14	return strconv.Itoa(counter.count)
15}