Search Apps Documentation Source Content File Folder Download Copy Actions Download

realmrecov.gno

0.31 Kb · 22 lines
 1package realmrecov
 2
 3import "strconv"
 4
 5type StateHolder struct {
 6	value int
 7}
 8
 9func (s *StateHolder) set(v int) {
10	s.value = v
11}
12
13var holder = StateHolder{value: 0}
14
15func SetAndPanic(v int) {
16	holder.set(v)
17	panic("deliberate panic after state write")
18}
19
20func Render(_ string) string {
21	return strconv.Itoa(holder.value)
22}