Closed
Description
Would it be an idea to let Invoke
take arguments that aren't coming from the container?
it seems rather straight forward to add this ( I managed in like 15min by just fiddling in my vendor folder ), which leads me to belief it's not in there for a (good) reason...?
something like;
// my super complicated service
type MyService struct {
Booyaa bool
}
// provide for my super complicated service
func NewMyService() *MyService {
return &MyService{}
}
func CanWeBooyaa(ctx *gin.Context, service *MyService) {
ctx.String(200, fmt.Sprintf("booyaa? %v! \n", service.Booyaa))
}
container := dig.New()
container.Provide(NewMyService)
ctx := &gin.Context{}
container.Invoke(CanWeBooyaa, ctx)
Metadata
Metadata
Assignees
Labels
No labels