mirror of
https://github.com/vbatts/tar-split.git
synced 2025-08-02 20:30:28 +00:00
*.go: linting project specific code
the pointer to the pool may be useful, but holding on that until I get benchmarks of memory use to show the benefit. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
19fa6f3d1e
commit
516158dbfb
4 changed files with 28 additions and 16 deletions
|
@ -18,13 +18,11 @@ 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.
|
||||
var err error
|
||||
go func(e error) {
|
||||
go func() {
|
||||
// Empty archive.
|
||||
tw := tar.NewWriter(pW)
|
||||
if err := tw.Close(); err != nil {
|
||||
pW.CloseWithError(err)
|
||||
e = err
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -36,7 +34,6 @@ func TestLargeJunkPadding(t *testing.T) {
|
|||
devZero, err := os.Open("/dev/zero")
|
||||
if err != nil {
|
||||
pW.CloseWithError(err)
|
||||
e = err
|
||||
return
|
||||
}
|
||||
defer devZero.Close()
|
||||
|
@ -46,17 +43,13 @@ func TestLargeJunkPadding(t *testing.T) {
|
|||
}
|
||||
if _, err := io.CopyN(pW, devZero, junkChunkSize); err != nil {
|
||||
pW.CloseWithError(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…
Add table
Add a link
Reference in a new issue