mirror of
https://github.com/vbatts/tar-split.git
synced 2024-12-18 11:36:30 +00:00
tar/asm: go vet fixes
on go1.19.7 Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
80a436fd61
commit
70fb294a9b
1 changed files with 9 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue