ICode9

精准搜索请尝试: 精确搜索
  • 单例模式2022-09-14 08:00:32

    单例模式 使用标准库 package singleton var ( once sync.Once singleton *Singleton ) type Singleton struct{} func NewSingleton() *Singleton{ once.Do(func(){ singleton = &Singleton{} }) return singleton } 不使用标准库 package singl

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有