Skip to content

Commit

Permalink
Merge pull request #184 from linkernetworks/johnlin/fix-golint
Browse files Browse the repository at this point in the history
[Lint] fix golint
  • Loading branch information
John-Lin authored Jul 27, 2018
2 parents 8607835 + 07f203b commit 4eaf3b6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/net/http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ type NativeContextHandler func(*web.NativeContext)
func CompositeServiceHandler(sp *serviceprovider.Container, handler NativeContextHandler) http.HandlerFunc {
return func(resp http.ResponseWriter, req *http.Request) {
logger.Infoln(req.Method, req.URL)
ctx := web.NativeContext{sp, req, resp}
ctx := web.NativeContext{
ServiceProvider: sp,
Request: req,
Response: resp,
}
handler(&ctx)
}
}
Expand All @@ -27,7 +31,11 @@ type RESTfulContextHandler func(*web.Context)
// RESTfulServiceHandler is the wrapper to combine the RESTfulContextHandler with our serviceprovider object
func RESTfulServiceHandler(sp *serviceprovider.Container, handler RESTfulContextHandler) restful.RouteFunction {
return func(req *restful.Request, resp *restful.Response) {
ctx := web.Context{sp, req, resp}
ctx := web.Context{
ServiceProvider: sp,
Request: req,
Response: resp,
}
handler(&ctx)
}
}

0 comments on commit 4eaf3b6

Please sign in to comment.