mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-02-04 06:46:18 +00:00
creational/singleton: fix dereferencing
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user