From cf0e4109603f68ce4680d4bab4f3f23b9030b7a8 Mon Sep 17 00:00:00 2001 From: james4e Date: Wed, 19 Oct 2016 22:35:51 +0800 Subject: [PATCH] creational/singleton: fix dereferencing --- creational/singleton.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) })