diff --git a/creational/singleton.md b/creational/singleton.md index 09ffeae..fa6c463 100644 --- a/creational/singleton.md +++ b/creational/singleton.md @@ -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) })