mirror of
https://github.com/crazybber/awesome-patterns.git
synced 2024-11-22 04:36:02 +03:00
creational/singleton: fix dereferencing
This commit is contained in:
parent
589531765d
commit
cf0e410960
@ -11,9 +11,9 @@ type singleton map[string]string
|
||||
|
||||
var once sync.Once
|
||||
|
||||
var instance *singleton
|
||||
var instance singleton
|
||||
|
||||
func New() *singleton {
|
||||
func New() singleton {
|
||||
once.Do(func() {
|
||||
instance = make(singleton)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user