tar/asm: go vet fixes

on go1.19.7

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-03-25 14:41:27 -04:00
parent 80a436fd61
commit 70fb294a9b
Signed by: vbatts
GPG Key ID: E30EFAA812C6E5ED
1 changed files with 9 additions and 5 deletions

View File

@ -18,12 +18,13 @@ func TestLargeJunkPadding(t *testing.T) {
// Write a normal tar file into the pipe and then load it full of junk
// bytes as padding. We have to do this in a goroutine because we can't
// store 20GB of junk in-memory.
go func() {
var err error
go func(e error) {
// Empty archive.
tw := tar.NewWriter(pW)
if err := tw.Close(); err != nil {
pW.CloseWithError(err)
t.Fatal(err)
e = err
return
}
@ -35,7 +36,7 @@ func TestLargeJunkPadding(t *testing.T) {
devZero, err := os.Open("/dev/zero")
if err != nil {
pW.CloseWithError(err)
t.Fatal(err)
e = err
return
}
defer devZero.Close()
@ -45,14 +46,17 @@ func TestLargeJunkPadding(t *testing.T) {
}
if _, err := io.CopyN(pW, devZero, junkChunkSize); err != nil {
pW.CloseWithError(err)
t.Fatal(err)
e = err
return
}
}
fmt.Fprintln(os.Stderr, "[TestLargeJunkPadding] junk chunk finished")
pW.Close()
}()
}(err)
if err != nil {
t.Fatal(err)
}
// Disassemble our junk file.
nilPacker := storage.NewJSONPacker(ioutil.Discard)