dir.Recreate() (#581)

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

View File

@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"os"
"path"
"path/filepath"
"syscall"
@ -74,9 +73,8 @@ func Exist(path string) bool {
}
func Recreate(dir string) {
aggDir := path.Join(dir, "agg22")
if Exist(aggDir) {
_ = os.RemoveAll(aggDir)
if Exist(dir) {
_ = os.RemoveAll(dir)
}
MustExist(aggDir)
MustExist(dir)
}