1package main2 3import (4 "fmt"5 "sync"6)7 8var (9 x = 010 store = map[string][]int{11 "k1": make([]int, 0),12 "k2": make([]int, 0),13 "k3": make([]int, 0),14 }15)16 17func main() {18 wg := sync.WaitGroup{}19 wg.Add(3)20 21 go func() {22 wg.Done()23 x = 2024 store["k1"] = append(store["k1"], x)25 }()26 27 go func() {28 wg.Done()29 x = 2130 store["k2"] = append(store["k2"], x)31 }()32 33 go func() {34 wg.Done()35 x = 2236 store["k3"] = append(store["k3"], x)37 }()38 39 wg.Wait()40 41 fmt.Printf("%v", store)42 fmt.Printf("%d", x)43}