Skip to content

Commit

Permalink
Merge pull request #39 from smoser/fix/restore-pkg.util
Browse files Browse the repository at this point in the history
Add the pkg/util code which escaped the last PR.
  • Loading branch information
hallyn authored Aug 24, 2023
2 parents 14a2a0d + 8ec65d1 commit d590060
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/util/file.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package util

import (
"io"
"os"
)

func CopyFileContents(src, dst string) error {
in, err := os.Open(src)
if err != nil {
return err
}
defer in.Close()
out, err := os.Create(dst)
if err != nil {
return err
}
defer out.Close()
if _, err := io.Copy(out, in); err != nil {
return err
}
return out.Sync()
}

0 comments on commit d590060

Please sign in to comment.