diff --git a/goes.go b/goes.go index f15000f..3781cff 100644 --- a/goes.go +++ b/goes.go @@ -358,11 +358,9 @@ func (req *Request) Run() (*Response, error) { return esResp, err } json.Unmarshal(body, &esResp.Raw) - } - - err = json.Unmarshal(body, &esResp) - if err != nil { - return &Response{Status: statusCode}, err + if err != nil { + return &Response{Status: statusCode}, err + } } if req.api == "_bulk" && esResp.Errors {