fix: Fix debug message printing when debug is disabled. (#1043)

This commit is contained in:
Lucas Teske 2022-03-29 10:00:28 -03:00 committed by GitHub
parent dec22d7483
commit 1292ea9e38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,7 +142,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")
}
}()