Go एक garbage collector के साथ स्वचालित रूप से memory प्रबंधित करता है, जो आपको manual allocation/freeing से मुक्त करता है। इसका GC एक concurrent, low-latency, non-generational mark-and-sweep collector है जो pause times को न्यूनतम करने के लिए design किया गया है — एक मुख्य कारण कि Go latency-sensitive services के लिए उपयुक्त है।
stack बनाम heap और escape analysis
{
x :=
x
}
* {
x :=
&x
}
