#What is wrong with this array that contain function call ?

10 messages · Page 1 of 1 (latest)

cold swan
#

any isn't good as *do.Injector ?

#

Cannot use 'logger.NewService'
(type func(_ *do.Injector) (*Service, error))
as the type
func(*do.Injector) (any, error)

slate rapids
#

service is not any

cold swan
#

I want to use any because I have different type of service

slate rapids
#

the slice's signature is func(*do.Injector) (any, error)

#

new service's signature is NewService(_ *do.Injector) (*Service, error)

#

it needs to also return any for it to match

cold swan
#

in the end I want to do something like
{logger.NewService, foo.NewService}
So I need any in array

slate rapids
#

dont think you really can

#

i dont think there's any other way short of []any{}