mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-02-04 14:46:19 +00:00
creational/singleton: group variable declarations
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user