File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
1616var responseStatusProviders = map [reflect.Type ]func (req * http.Request ) types.ResponseStatusProvider {}
1717
1818func RegisterResponseStatusProvider [T any ](fn func (req * http.Request ) types.ResponseStatusProvider ) {
19- responseStatusProviders [reflect .TypeOf (( * T )( nil )). Elem ()] = fn
19+ responseStatusProviders [reflect .TypeFor [ T ] ()] = fn
2020}
2121
2222// responseWriter is a wrapper of http.ResponseWriter, to check whether the response has been written
@@ -48,8 +48,8 @@ func (r *responseWriter) WriteHeader(statusCode int) {
4848}
4949
5050var (
51- httpReqType = reflect .TypeOf (( * http .Request )( nil ) )
52- respWriterType = reflect .TypeOf (( * http .ResponseWriter )( nil )). Elem ()
51+ httpReqType = reflect .TypeFor [ * http.Request ]( )
52+ respWriterType = reflect .TypeFor [ http.ResponseWriter ] ()
5353)
5454
5555// preCheckHandler checks whether the handler is valid, developers could get first-time feedback, all mistakes could be found at startup
You can’t perform that action at this time.
0 commit comments