(sourcePath, destinationPath string)
| 155 | } |
| 156 | |
| 157 | func copyFile(sourcePath, destinationPath string) error { |
| 158 | source, err := os.Open(sourcePath) |
| 159 | if err != nil { |
| 160 | return err |
| 161 | } |
| 162 | defer func() { _ = source.Close() }() |
| 163 | |
| 164 | destination, err := os.Create(destinationPath) |
| 165 | if err != nil { |
| 166 | return err |
| 167 | } |
| 168 | defer func() { _ = destination.Close() }() |
| 169 | |
| 170 | _, err = io.Copy(destination, source) |
| 171 | return err |
| 172 | } |
| 173 | |
| 174 | func copyDir(sourceDir, destinationDir string) error { |
| 175 | sourceStat, err := os.Stat(sourceDir) |
no test coverage detected