dropCreateDir drop and create output directory
(dir string)
| 171 | |
| 172 | // dropCreateDir drop and create output directory |
| 173 | func dropCreateDir(dir string) error { |
| 174 | if err := os.RemoveAll(dir); err != nil { |
| 175 | return fmt.Errorf("remove dir: %w", err) |
| 176 | } |
| 177 | |
| 178 | if err := mkdirAll(dir); err != nil { |
| 179 | return fmt.Errorf("create dir: %w", err) |
| 180 | } |
| 181 | |
| 182 | return nil |
| 183 | } |
| 184 | |
| 185 | func mkdirAll(path string) error { |
| 186 | _, err := os.Stat(path) |
no test coverage detected