Working with Slices and Golang sync.Map Structure
问题 In order to debug some concurrency issues, I am in the process of switching part of my code from working on a regular Golang map to working on a sync.Map. However, when I try to run my new code, I am encountering two errors that I'm not sure how to debug. The original code block: sync_mutex.Lock() if _, ok := the_map[cur_h]; ok { the_map[cur_h] = append(the_map[cur_h], cur_id) } else { value := []int{cur_id} the_map[cur_h] = value } sync_mutex.Unlock() The new code block: if _, ok := sync_map