What is a goroutine in Go?

Answer

A goroutine is a lightweight, concurrently executing function managed by the Go runtime. You start one by prefixing a function call with the go keyword: go myFunc(). Unlike OS threads, goroutines start with a tiny stack (about 2 KB) that grows dynamically, so you can launch thousands or even millions of them without exhausting memory. The Go scheduler multiplexes goroutines onto OS threads automatically. Goroutines are the fundamental unit of concurrency in Go and are central to idiomatic Go design.