Q:使用redigo协程并发报错
参考:https://studygolang.com/articles/21266
协程同时send
write tcp 192.168.10.66:7289->192.168.10.66:6379: wsasend: An existing connection was forcibly closed by the remote host.
协程同时DO
short write
write tcp 192.168.10.66:7643->192.168.10.66:6379: use of closed network connection
goredis 说明
Connections support one concurrent caller to the Receive method and one concurrent caller to the Send and Flush methods. No other concurrency is supported including concurrent calls to the Do and Close methods.
A:解决方案
1.使用pool 解决 (推荐)
2.加锁