You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package singleton
|
|
|
|
type Singleton struct{}
|
|
|
|
var singleton *Singleton
|
|
|
|
func init() {
|
|
singleton = &Singleton{}
|
|
}
|
|
|
|
// GetHungerInstance
|
|
//
|
|
// @Description: 饿汉式获取实例
|
|
// @return *Singleton
|
|
func GetHungerInstance() *Singleton {
|
|
return singleton
|
|
}
|