github.com/goplus/gop@v1.2.6/printer/_testdata/27-Func-Set/func.gop (about) 1 func A(a *int, c *struct { 2 b *int 3 m map[string]*int 4 s []*int 5 }) { 6 *a = 5 7 *c.b = 3 8 *c.m["foo"] = 7 9 *c.s[0] = 9 10 } 11 12 func Index() int { 13 return 0 14 } 15 16 a1 := 6 17 a2 := 6 18 a3 := 6 19 c := struct { 20 b *int 21 m map[string]*int 22 s []*int 23 }{ 24 b: &a1, 25 m: map[string]*int{ 26 "foo": &a2, 27 }, 28 s: []*int{&a3}, 29 } 30 A(&a1, &c) 31 *c.m["foo"] = 8 32 *c.s[0] = 10 33 *c.s[Index()] = 11 34 println(a1, *c.b, *c.m["foo"], *c.s[0])