From 196a6f54f2eb72f2647b6bb63b782920d6162c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Sim=C3=A3o?= Date: Tue, 26 Oct 2021 17:57:38 +0000 Subject: [PATCH] Update 'lib.go' --- lib.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib.go b/lib.go index 59c9b0f..53fc0e2 100644 --- a/lib.go +++ b/lib.go @@ -7,6 +7,7 @@ import ( "io" "net/http" "strings" + "fmt" ) type Cli struct { @@ -57,7 +58,7 @@ func (c *Cli) Do(method string, strurl string, body []byte) (*http.Response, err } res,err:= c.cli.Do(req) if err==nil && res.StatusCode >=400{ - return nil, errors.New("Http return code - %d: %s",res.StatusCode,res.Status) + return nil, errors.New(fmt.Sprintf("Http return code - %d: %s",res.StatusCode,res.Status)) } return res,err }