Skip to content

Commit

Permalink
fixup: use errors.Is() ; explicitly ignore error;
Browse files Browse the repository at this point in the history
  • Loading branch information
aramprice committed Jul 20, 2024
1 parent c0cd47a commit b699ebe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions package_stemcell/stemcell_generator/tar/tar_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
archiveTar "archive/tar"
"bytes"
"compress/gzip"
"errors"
"io"
"os"
"path/filepath"
Expand Down Expand Up @@ -39,7 +40,6 @@ var _ = Describe("TarWriter", func() {
Expect(err).NotTo(HaveOccurred())

err = w.Write("some-file", fakeTarable)

Expect(err).NotTo(HaveOccurred())
})

Expand All @@ -50,7 +50,6 @@ var _ = Describe("TarWriter", func() {
Expect(err).NotTo(HaveOccurred())

err = w.Write("some-file", fakeTarable)

Expect(err).NotTo(HaveOccurred())

tarBall := filepath.Join(workingDir, "some-file")
Expand Down Expand Up @@ -83,13 +82,14 @@ var _ = Describe("TarWriter", func() {

gzr, err := gzip.NewReader(fileReader)
Expect(err).ToNot(HaveOccurred())
defer gzr.Close()
defer func() { _ = gzr.Close() }()

tarReader := archiveTar.NewReader(gzr)
var actualContents []string
var actualFilenames []string
for {
header, err := tarReader.Next()
if err == io.EOF {
if errors.Is(err, io.EOF) {
break
}
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit b699ebe

Please sign in to comment.