We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package singleton import "sync" //Singleton 是单例模式类 type Singleton struct{} var singleton *Singleton var once sync.Once //GetInstance 用于获取单例模式对象 func GetInstance() *Singleton { once.Do(func() { singleton = &Singleton{} }) return singleton }
=>
package singleton import "sync" //Singleton 是单例模式类 type singleton struct{} var singleton *singleton var once sync.Once //GetInstance 用于获取单例模式对象 func GetInstance() *singleton { once.Do(func() { singleton = &singleton{} }) return singleton }
The text was updated successfully, but these errors were encountered:
Good Job。如果可以的话,麻烦提个PR。直接做一下合并。
Sorry, something went wrong.
No branches or pull requests
=>
The text was updated successfully, but these errors were encountered: