package test import ( "fmt" "sync" "testing" ) func TestSyncMap(t *testing.T) { m := new(sync.Map) m.Store("k1", "v1") value, ok := m.Load("k1") if ok { fmt.Println("值为", value) } }