(srcPath, destPath string, writer io.Writer)
| 93 | } |
| 94 | |
| 95 | func makeTar(srcPath, destPath string, writer io.Writer) error { |
| 96 | gw := gzip.NewWriter(writer) |
| 97 | defer gw.Close() |
| 98 | tarWriter := tar.NewWriter(gw) |
| 99 | defer tarWriter.Close() |
| 100 | |
| 101 | srcPath = path.Clean(srcPath) |
| 102 | destPath = path.Clean(destPath) |
| 103 | return recursiveTar(path.Dir(srcPath), path.Base(srcPath), path.Dir(destPath), path.Base(destPath), tarWriter) |
| 104 | } |
| 105 | |
| 106 | func recursiveTar(srcBase, srcFile, destBase, destFile string, tw *tar.Writer) error { |
| 107 | srcPath := path.Join(srcBase, srcFile) |
no test coverage detected