singleton_pattern

package
v0.0.0-...-eb36113 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIns

func GetIns() *singleton3

func GetIns1Or

func GetIns1Or() *singleton1

func GetIns2Or

func GetIns2Or() *singleton2

func GetInsOr

func GetInsOr() *singleton

使用once.Do可以确保 ins 实例全局只被创建一次, once.Do 函数还可以确保当同时有多个创建动作时,只有一个创建动作在被执行, 内部也是 mutex.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL