MCPcopy
hub / github.com/avelino/awesome-go / dropCreateDir

Function dropCreateDir

main.go:173–183  ·  view source on GitHub ↗

dropCreateDir drop and create output directory

(dir string)

Source from the content-addressed store, hash-verified

171
172// dropCreateDir drop and create output directory
173func 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
185func mkdirAll(path string) error {
186 _, err := os.Stat(path)

Callers 1

buildStaticSiteFunction · 0.85

Calls 1

mkdirAllFunction · 0.85

Tested by

no test coverage detected