tally.gno
0.48 Kb · 22 lines
1// Package tally is a minimal public tally board: anyone can bump the
2// counter, and the current count is readable back via Render or Count.
3package tally
4
5import "strconv"
6
7var count int
8
9// Bump increments the shared counter by one and returns the new count.
10func Bump(cur realm) int {
11 count++
12 return count
13}
14
15// Count returns the current tally.
16func Count() int {
17 return count
18}
19
20func Render(_ string) string {
21 return "# Tally board\n\nCurrent count: " + strconv.Itoa(count) + "\n"
22}