deletes the contents of a directory
(path string)
| 283 | |
| 284 | // deletes the contents of a directory |
| 285 | func removeDirContents(path string) error { |
| 286 | files, err := os.ReadDir(path) |
| 287 | if err != nil { |
| 288 | return err |
| 289 | } |
| 290 | |
| 291 | for _, file := range files { |
| 292 | if err := os.RemoveAll(filepath.Join(path, file.Name())); err != nil { |
| 293 | return err |
| 294 | } |
| 295 | } |
| 296 | return nil |
| 297 | } |
no test coverage detected
searching dependent graphs…