From 9387c79a1862e7572ffc59919c05cf1dc9aeeae5 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Thu, 2 Sep 2021 15:04:05 +0200 Subject: find similar chunks while matching stream --- tar.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tar.go') diff --git a/tar.go b/tar.go index e811840..e2703c8 100644 --- a/tar.go +++ b/tar.go @@ -26,18 +26,16 @@ func streamFilesTar(files []File, stream io.WriteCloser) { continue } if err := tarStream.WriteHeader(hdr); err != nil { - log.Printf("Error writing tar header to stream for file '%s': %s\n", f.Path, err) - continue + log.Panicf("Error writing tar header to stream for file '%s': %s\n", f.Path, err) } if _, err := io.Copy(tarStream, file); err != nil { - log.Printf("Error writing file to stream '%s': %s\n", f.Path, err) - continue + log.Panicf("Error writing file to stream '%s': %s\n", f.Path, err) } } if err := tarStream.Close(); err != nil { - log.Fatal("Error closing tar stream:", err) + log.Panic("Error closing tar stream:", err) } if err := stream.Close(); err != nil { - log.Fatal("Error closing stream:", err) + log.Panic("Error closing stream:", err) } } -- cgit v1.2.3