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 wsw_seu 阅读(171) 评论(0) 推荐(0) 编辑