Go automatically manages memory with a garbage collector, freeing you from manual allocation/freeing. Its GC is a concurrent, low-latency, non-generational mark-and-sweep collector designed to minimize pause times — a key reason Go suits latency-sensitive services.
Stack vs heap and escape analysis
{
x :=
x
}
* {
x :=
&x
}
