dir.Recreate() (#580)

This commit is contained in:
Alex Sharov 2022-08-12 17:48:00 +07:00 committed by GitHub
parent c96a22dcdc
commit 8ed848acbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"os"
"path"
"path/filepath"
"syscall"
@ -71,3 +72,11 @@ func Exist(path string) bool {
}
return true
}
func Recreate(dir string) {
aggDir := path.Join(dir, "agg22")
if Exist(aggDir) {
_ = os.RemoveAll(aggDir)
}
MustExist(aggDir)
}