in fc/http_handler.go [35:52]
func validateHttpArguments(handler reflect.Type) error {
if handler.NumIn() != 3 {
return fmt.Errorf("http handler should takes three arguments, but handler takes %d", handler.NumIn())
}
contextType := reflect.TypeOf((*context.Context)(nil)).Elem()
argumentType := handler.In(0)
if !argumentType.Implements(contextType) {
return fmt.Errorf("handler takes three arguments, but the first is not Context. got %s",
argumentType.Kind())
}
responseWriterType := reflect.TypeOf((*http.ResponseWriter)(nil)).Elem()
argumentType = handler.In(1)
if !argumentType.Implements(responseWriterType) {
return fmt.Errorf("handler takes three arguments, but the second is not http.ResponseWriter. got %s",
argumentType.Kind())
}
return nil
}