go-zero
go-zero copied to clipboard
singleflight--->sync.Map
//说明:sync.Map的原子操作,适用于读多很少,相比以前读写都使用mutex,性能会更好 //测试用例部分过不了,需要先执行fn() 函数获取val,,Kevin老师是否考虑使用sync.Map
The scenarios on using singleflight are with IO operations, performance is not a problem here.