mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
integration-cli: TestContainerAPIGetExport: fix minor linting issues
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user