mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-11-11 23:07:51 +03:00
creational/singleton: fix dereferencing
This commit is contained in:
1 parent
589531765d
commit
cf0e410960
1 file changed
+2
-2
@@ -11,9 +11,9 @@ type singleton map[string]string
|
|||||||
|
|
||||||
var once sync.Once
|
var once sync.Once
|
||||||
|
|
||||||
var instance *singleton
|
var instance singleton
|
||||||
|
|
||||||
func New() *singleton {
|
func New() singleton {
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
instance = make(singleton)
|
instance = make(singleton)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user