creational/singleton: fix dereferencing

This commit is contained in:
james4e 2016-10-19 22:35:51 +08:00 committed by Tamer Tas
parent 589531765d
commit cf0e410960

View File

@ -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)
})