Explorar el Código

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

Lucas Teske hace 3 años
padre
commit
1292ea9e38
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      restapi.go

+ 1 - 1
restapi.go

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