rename reqBody variable to request

This commit is contained in:
Hunyadvári Péter 2019-05-02 18:06:43 +02:00
parent 08d70c9d0a
commit aaf4a5c51a

View File

@ -83,11 +83,11 @@ func (m *MockClient) Call(ctx context.Context, req client.Request, rsp interface
}
response := r.Response
if t := reflect.TypeOf(r.Response); t.Kind() == reflect.Func {
var reqBody []reflect.Value
var request []reflect.Value
if t.NumIn() == 1 {
reqBody = append(reqBody, reflect.ValueOf(req.Body()))
request = append(request, reflect.ValueOf(req.Body()))
}
response = reflect.ValueOf(r.Response).Call(reqBody)[0].Interface()
response = reflect.ValueOf(r.Response).Call(request)[0].Interface()
}
v.Set(reflect.ValueOf(response))