3 ms·
Go also certainly supports this. Here's a playground example: https://play.golang.org/p/_BLguocGBRn https://play.golang.org/p/_BLguocGBRn
by oconnor663 8y ago
Go also certainly supports this. Here's a playground example: https://play.golang.org/p/_BLguocGBRn https://play.golang.org/p/_BLguocGBRn
- codemac 8y agoDoes Go take a copy or a reference?
- rhencke 8y agoThe following example will provide your answer: https://play.golang.org/p/NeGuDahW2yP https://play.golang.org/p/NeGuDahW2yP
- mikepurvis 8y agoThe captured context persists between calls to the function, as the sibling example demonstrates, or this one: https://play.golang.org/p/drfx_3g84aE https://play.golang.org/p/drfx_3g84aE