Don't append a second .gz extension

This commit is contained in:
Michael Kaye 2022-01-18 17:30:50 +00:00
parent d337ec9843
commit 523333f5a0

View file

@ -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)
}