diff --git a/restapi.go b/restapi.go index e3817d233..2019a4729 100644 --- a/restapi.go +++ b/restapi.go @@ -108,7 +108,7 @@ func (s *Session) RequestWithLockedBucket(method, urlStr, contentType string, b } defer func() { err2 := resp.Body.Close() - if err2 != nil { + if s.Debug && err2 != nil { log.Println("error closing resp body") } }()