Skip to content

Commit

Permalink
Make code more readable and consistent regards return values
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrunwald committed Sep 10, 2018
1 parent 5f93656 commit 30ce279
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions changes.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,17 +781,16 @@ func (s *ChangesService) change(tail string, changeID string, input interface{})
v := new(ChangeInfo)
resp, err := s.client.Do(req, v)
if err != nil {
return v, resp, err
return nil, resp, err
}
if resp.StatusCode == http.StatusConflict {
var body []byte
body, err = ioutil.ReadAll(resp.Body)
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return v, resp, err
}
err = errors.New(string(body[:]))
return v, resp, errors.New(string(body[:]))
}
return v, resp, err
return v, resp, nil
}

// SubmitChange submits a change.
Expand Down

0 comments on commit 30ce279

Please sign in to comment.