Fixed gziping function for debug archive (#5184)
This commit is contained in:
parent
87763ac96b
commit
8831b043ab
|
@ -610,7 +610,7 @@ func (c *cmd) createArchiveTemp(path string) (tempName string, err error) {
|
|||
}
|
||||
|
||||
g := gzip.NewWriter(f)
|
||||
t := tar.NewWriter(f)
|
||||
t := tar.NewWriter(g)
|
||||
|
||||
tempName = f.Name()
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package debug
|
|||
|
||||
import (
|
||||
"archive/tar"
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
@ -94,7 +95,11 @@ func TestDebugCommand_Archive(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("failed to open archive: %s", err)
|
||||
}
|
||||
tr := tar.NewReader(file)
|
||||
gz, err := gzip.NewReader(file)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to read gzip archive: %s", err)
|
||||
}
|
||||
tr := tar.NewReader(gz)
|
||||
|
||||
for {
|
||||
h, err := tr.Next()
|
||||
|
|
Loading…
Reference in New Issue