Search Apps Documentation Source Content File Folder Download Copy Actions Download

helloworld.gno

0.30 Kb · 22 lines
 1package helloworld
 2
 3import "strconv"
 4
 5var counter int
 6
 7func init() {
 8    counter = 0
 9}
10
11func Increment(cur realm) int {
12    counter++
13    return counter
14}
15
16func GetCounter() int {
17    return counter
18}
19
20func Render(_ string) string {
21    return "# Hello from Gno!\n\nCounter: " + strconv.Itoa(counter) + "\n"
22}