3 ms·
Rob Pike has a Q&A at the end of his video where he answers (what sounds like) the exact same question you ask: http://youtu.be/f6kdp27TYZs?t=46m17s http://yout
by biot 14y ago
Rob Pike has a Q&A at the end of his video where he answers (what sounds like) the exact same question you ask: http://youtu.be/f6kdp27TYZs?t=46m17s http://youtu.be/f6kdp27TYZs?t=46m17s
Essentially, it gets garbage collected without you having to worry about it unless you're doing something fairly special.
- Benferhat 14y agoNice find! Although, he doesn't really answer the question, which had to be asked more than once in that video. I'd love to see a talk going in-depth on this topic alone.
- kfl 14y agoExcept that Rob Pike later in the golang-nuts groups expand on exactly that question: https://groups.google.com/d/topic/golang-nuts/bfuwmhbZHYw/discussion https://groups.google.com/d/topic/golang-nuts/bfuwmhbZHYw/di... Qoute: "Goroutines are not garbage-collected. They must return from the top-level function (or panic) to have all their resources recovered."