mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-11-11 23:07:51 +03:00
creational/singleton: group variable declarations
This commit is contained in:
1 parent
a523c5f6f3
commit
dc42cd7206
1 file changed
+4
-2
@@ -9,9 +9,11 @@ package singleton
|
||||
|
||||
type singleton map[string]string
|
||||
|
||||
var once sync.Once
|
||||
var (
|
||||
once sync.Once
|
||||
|
||||
var instance singleton
|
||||
instance singleton
|
||||
)
|
||||
|
||||
func New() singleton {
|
||||
once.Do(func() {
|
||||
|
||||
Reference in new issue
Block a user