command
Version:
v0.0.0-...-0216257
Opens a new window with list of versions in this module.
Published: Jun 3, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Singleton 单件:
保证一个类仅有一个实例,并提供一个访问它的全局访问点
1.单纯使用is nil判断存在并发问题
2.使用mutex 锁机制,非原子操作
2.创建实例时,用同步库sync.Once来保证全局只有一个对象实例。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.