fix golint issues, exported doc (#451)
This commit is contained in:
@@ -7,12 +7,13 @@ import (
|
||||
|
||||
const reason = "Request Timeout"
|
||||
|
||||
// TimeoutHandler returns the handler with given timeout.
|
||||
func TimeoutHandler(duration time.Duration) func(http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
if duration > 0 {
|
||||
return http.TimeoutHandler(next, duration, reason)
|
||||
} else {
|
||||
return next
|
||||
}
|
||||
|
||||
return next
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user