Goroutines are lightweight threads managed by the Go runtime that execute functions concurrently using the go keyword. They communicate and synchronize via channels, allowing multiple tasks to run simultaneously without blocking the main program.
package main
import "fmt"
func main() {
go func() {
fmt.Println("Running in a goroutine")
}()
fmt.Println("Main function continues")
}