v0.12.0
The request-scope middleware becomes a dependency a server's constructor can
take, so an application needs no Provide closure to serve HTTP. go doc -all against 0.11.0 leaves di untouched and changes dihttp: Middleware
is now the type, NewMiddleware makes one, Module registers one. The rename
is the breaking change, and the reason for the minor bump.
Changed
dihttp.Middlewareis now the type,func(http.Handler) http.Handler, so
a server's constructor can take one as a parameter; the function that
makes one isdihttp.NewMiddleware. A calldihttp.Middleware(app)no
longer compiles: rename it, or take the middleware as a dependency.
Added
dihttp.Moduleregisters aMiddlewareover the scope it is applied to.
With it the guide's server is a wired constructor with its dependencies
declared, and the guide application uses noProvideclosure at all.