We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff7c22d commit d9b51d0Copy full SHA for d9b51d0
modules/dump/dumper_test.go
@@ -137,21 +137,15 @@ func TestDumper(t *testing.T) {
137
})
138
}
139
140
-func extractTarFileNames(t *testing.T, buf *bytes.Buffer) []string {
141
- var fileNames []string
142
-
+func extractTarFileNames(t *testing.T, buf *bytes.Buffer) (fileNames []string) {
143
tr := tar.NewReader(buf)
144
for {
145
hdr, err := tr.Next()
146
if err == io.EOF {
147
break
148
149
- assert.NoError(t, err, "Error reading tar archive")
150
151
- if hdr.Typeflag == tar.TypeReg || hdr.Typeflag == tar.TypeDir {
152
- fileNames = append(fileNames, hdr.Name)
153
- }
+ require.NoError(t, err, "Error reading tar archive")
+ fileNames = append(fileNames, hdr.Name)
154
155
156
return fileNames
157
0 commit comments