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 }