Skip to content

Commit

Permalink
use fmt.Errorf
Browse files Browse the repository at this point in the history
  • Loading branch information
probakowski committed Nov 17, 2021
1 parent 029ce6a commit c5226ad
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions viessmann.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package viessmann

import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -250,7 +249,7 @@ func (v *Api) get(path string, t interface{}) error {
return err
}
if res.StatusCode != http.StatusOK {
return errors.New(fmt.Sprintf("%d: %s", res.StatusCode, body))
return fmt.Errorf("%d: %s", res.StatusCode, body)
}

err = json.Unmarshal(body, t)
Expand Down

0 comments on commit c5226ad

Please sign in to comment.