integration-cli: TestContainerAPIGetExport: fix minor linting issues

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-07-26 11:13:27 +02:00
parent f73aba83dc
commit 97827e1a58

View File

@@ -112,10 +112,10 @@ func (s *DockerAPISuite) TestContainerAPIGetExport(c *testing.T) {
found := false
for tarReader := tar.NewReader(body); ; {
h, err := tarReader.Next()
if err != nil && err == io.EOF {
if errors.Is(err, io.EOF) {
break
}
if h.Name == "test" {
if h != nil && h.Name == "test" {
found = true
break
}
@@ -177,10 +177,11 @@ func (s *DockerAPISuite) TestGetContainerStats(c *testing.T) {
c.Fatal("stream was not closed after container was removed")
case sr := <-bc:
dec := json.NewDecoder(sr.stats.Body)
defer sr.stats.Body.Close()
var s *container.StatsResponse
// decode only one object from the stream
assert.NilError(c, dec.Decode(&s))
err := dec.Decode(&s)
_ = sr.stats.Body.Close()
assert.NilError(c, err)
}
}