From 523333f5a04769d6b2a832d49044d15f8a8cfe17 Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Tue, 18 Jan 2022 17:30:50 +0000 Subject: [PATCH] Don't append a second `.gz` extension --- submit.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/submit.go b/submit.go index c680351..e457b30 100644 --- a/submit.go +++ b/submit.go @@ -438,7 +438,11 @@ func saveLogPart(logNum int, filename string, reader io.Reader, reportDir string // Either way, we need to append .gz, because we're compressing it. var leafName string if logRegexp.MatchString(filename) { - leafName = filename + ".gz" + if strings.HasSuffix(filename, ".gz") { + leafName = filename + } else { + leafName = filename + ".gz" + } } else { leafName = fmt.Sprintf("logs-%04d.log.gz", logNum) }