Multitasking, Golang, Software Development, Concurrency, Parallel Computing.
Example of using WaitGroup: package main import ( "fmt" "sync" "time" ) func worker(id int, wg *sync.WaitGroup) { // Decrease the counter when the goroutine is finished defer wg.Done() // Simulate some work. fmt.Printf("Worker %d started\n", id) time.Sleep(time.Second) fmt.Printf("Worker %d