diff --git a/goes.go b/goes.go index 1cf3b38..b162306 100644 --- a/goes.go +++ b/goes.go @@ -345,14 +345,14 @@ func (req *Request) Run() (Response, error) { } esResp := new(Response) - if req.method == "HEAD" { - esResp.Status = uint64(resp.StatusCode) - } else { - err = json.Unmarshal(body, &esResp) - if err != nil { - return Response{}, err - } - } + if req.method == "HEAD" { + esResp.Status = uint64(resp.StatusCode) + } else { + err = json.Unmarshal(body, &esResp) + if err != nil { + return Response{}, err + } + } if req.api == "_bulk" && esResp.Errors { for _, item := range esResp.Items {