golang单例模式
摘要:一般写法 type singleton struct{ } var mu sync.Mutex var instance *singleton func GetInstance() *singleton{ if instance == nil{ mu.Lock() defer mu.Unlock()
阅读全文
posted @ 2020-05-09 14:41
posted @ 2020-05-09 14:41
posted @ 2020-05-09 11:11
posted @ 2020-05-06 20:16