Update 'lib.go'
parent
f665dba9a0
commit
196a6f54f2
3
lib.go
3
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue