github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/docs/assets/how-to-guides/testing-gno/counter-1.gno (about)

     1  // counter-app/r/counter/counter.gno
     2  
     3  package counter
     4  
     5  import (
     6  	"gno.land/p/demo/ufmt"
     7  )
     8  
     9  var count int
    10  
    11  func Increment() {
    12  	count++
    13  }
    14  
    15  func Decrement() {
    16  	count--
    17  }
    18  
    19  func Render(_ string) string {
    20  	return ufmt.Sprintf("Count: %d", count)
    21  }