Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Note: "finalize"-hints in Go are just curly braces, which begin and end blocks. Variables local to the scope are "finalized" (i.e. collectable, assuming they live on the heap) when the block ends.


Note: "finalize"-hints in Go are just curly braces, which begin and end blocks.

But sometimes objects will survive the close braces.


I'm not sure I understand: do you mean that they are collected after the program counter hits the last instruction of a given scope or are you implying that scope-local variables outlive their scope somehow?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: