type Get func(serviceName string) interface{}
type ServiceConstructor func(get Get) interface{}
type Get func(serviceName string) interface{}
type ServiceConstructor func(get Get) interface{}
golang中函数是一等公民,服务构建器类型是一个入参为函数返回任意的函数类型
本质上是一个入参为函数,返回值为任意类型的函数类型,类似如高阶函数
type ServiceConstructor func(get func(serviceName string) interface{}) interface{}
这个能看懂吗
type Get string
这个能看懂吗
func(serviceName string) interface{}
那这样不就能看懂了
type Get func(serviceName string) interface{}