golang map引发的 【fatal error: concurrent map read and map write】问题解决

【问题】我们写的golang程序不定期会抛出fatal error: concurrent map read and map write 的异常 【原因】排查代码,发现是创建session的时候,用到map会引发这个异常,go1.9之前的版本 map都是线程不安全的,在1.9版本之后,引入了sync.Map这种线程安全的map 【解决】把map[interface{}]interface{} 这种
相关文章
相关标签/搜索