Skip to content

Commit

Permalink
feat: remove Sprintf from color.Errorln
Browse files Browse the repository at this point in the history
  • Loading branch information
juev committed Oct 1, 2023
1 parent 13a1857 commit 6bfcb8f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gobrew.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ func doRequest(url string, token string) (data []byte) {
client := &http.Client{}
request, err := http.NewRequest("GET", url, nil)
if err != nil {
color.Errorln(fmt.Sprintf("==> [Error] Cannot create request: %s", err))
color.Errorln("==> [Error] Cannot create request:", err.Error())
return
}

Expand All @@ -702,7 +702,7 @@ func doRequest(url string, token string) (data []byte) {

response, err := client.Do(request)
if err != nil {
color.Errorln(fmt.Sprintf("==> [Error] Cannot get response: %s", err))
color.Errorln("==> [Error] Cannot get response:", err.Error())
return
}

Expand All @@ -716,13 +716,13 @@ func doRequest(url string, token string) (data []byte) {
}

if response.StatusCode != http.StatusOK {
color.Errorln(fmt.Sprintf("==> [Error] Cannot read response: %s", response.Status))
color.Errorln("==> [Error] Cannot read response:", response.Status)
return
}

data, err = io.ReadAll(response.Body)
if err != nil {
color.Errorln(fmt.Sprintf("==> [Error] Cannot read response Body: %s", err))
color.Errorln("==> [Error] Cannot read response Body:", err.Error())
return
}

Expand Down

0 comments on commit 6bfcb8f

Please sign in to comment.