For example, if I have some type A struct { B string; C int }
, and I have a func foo(a A) *string { return &a.B }
, and I call it with c := foo(a)
, will a
necessarily stay in context until c
is collectible?
Or, if I define func foo1(a A) *string { s := a.B; return &s }
will that have any effect on when the A
can be collected?