//https://studygolang.com/articles/11444 type singleton struct{} var ins *singleton var once sync.Once func GetIns() *singleton { once.Do(func(){ ins = &singleton{} }) return ins }