From 385917e22c5bd0d577a5a0be0de9e88a0499fe87 Mon Sep 17 00:00:00 2001 From: Josh Hawn Date: Wed, 3 Dec 2014 22:23:31 -0800 Subject: [PATCH] Correctly close generated benchmark archives Another update to TarSum tests, this patch fixes an issue where the benchmarks were generating archives incorrectly by not closing the tarWriter. Docker-DCO-1.1-Signed-off-by: Josh Hawn (github: jlhawn) --- pkg/tarsum/tarsum_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/tarsum/tarsum_test.go b/pkg/tarsum/tarsum_test.go index 4e1f30e469..26f12cc847 100644 --- a/pkg/tarsum/tarsum_test.go +++ b/pkg/tarsum/tarsum_test.go @@ -132,6 +132,7 @@ func sizedTar(opts sizedOptions) io.Reader { fh = bytes.NewBuffer([]byte{}) } tarW := tar.NewWriter(fh) + defer tarW.Close() for i := int64(0); i < opts.num; i++ { err := tarW.WriteHeader(&tar.Header{ Name: fmt.Sprintf("/testdata%d", i),