type CreateUser struct {
store storage.Store
cache caching.Cache
logger logging.Logger
pub events.Publisher
// etc
}func (op CreateUser) ServeHTTP(ctx, req, rw) {}
// or if you have custom handlers
func (op CreateUser) ServeHTTP(ctx, input) (output, error) {}
And in my main.go, or where I set up my dependencies, I create each operation, passing it its specific dependencies. I love that because I can keep all the helper methods for that specific operation/handler on that specific struct as private methods.
It does get tedious when you have one operation needing another, as you might start passing these around or you extract that into its own package/service.