Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

foo.gno

0.50 Kb · 22 lines
 1package tests_foo
 2
 3import (
 4	tests "gno.land/r/tests/vm"
 5)
 6
 7// for testing gno.land/r/tests/vm/interfaces.go
 8
 9type FooStringer struct {
10	FieldA string
11}
12
13func (fs *FooStringer) String() string {
14	return "&FooStringer{" + fs.FieldA + "}"
15}
16
17// AddFooStringer is a non-crossing helper. Callers thread their own
18// live cur as `rlm`; `cross(rlm)` forwards it into the (cur realm)-
19// crossing tests.AddStringer.
20func AddFooStringer(_ int, rlm realm, fa string) {
21	tests.AddStringer(cross(rlm), &FooStringer{fa})
22}