mirror of
https://github.com/crazybber/awesome-patterns.git
synced 2024-11-22 04:36:02 +03:00
creational/singleton: group variable declarations
This commit is contained in:
parent
a523c5f6f3
commit
dc42cd7206
@ -9,9 +9,11 @@ package singleton
|
|||||||
|
|
||||||
type singleton map[string]string
|
type singleton map[string]string
|
||||||
|
|
||||||
var once sync.Once
|
var (
|
||||||
|
once sync.Once
|
||||||
|
|
||||||
var instance singleton
|
instance singleton
|
||||||
|
)
|
||||||
|
|
||||||
func New() singleton {
|
func New() singleton {
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user