Remove copySparseFile

It is unused, and it clearly doesn't work (it closes dest
before writing anything to it).

Just drop it, it can always be re-added.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2024-03-07 14:08:54 +01:00
parent 56e0f063bd
commit a65b546c61
1 changed files with 0 additions and 16 deletions

View File

@ -161,22 +161,6 @@ func teardown(origHomeDir string, testDir string, mb *machineTestBuilder) {
}
}
// copySparseFile is a helper method for tests only. copies a file sparsely
// between two string inputs
func copySparseFile(src, dst string) error { //nolint:unused
dstWriter, err := os.OpenFile(dst, os.O_CREATE|os.O_RDWR, 0600)
if err != nil {
return err
}
dstWriter.Close()
fSrc, err := os.Open(src)
if err != nil {
return err
}
defer fSrc.Close()
return copySparse(dstWriter, fSrc)
}
// copySparse is a helper method for tests only; caller is responsible for closures
func copySparse(dst compression.WriteSeekCloser, src io.Reader) error {
spWriter := compression.NewSparseWriter(dst)