Fix typo and run go fmt over fs_util

This commit is contained in:
Антон Костенко 2019-09-18 10:43:26 +02:00
parent a1cc42bdb7
commit a21129f889
1 changed files with 4 additions and 3 deletions

View File

@ -121,8 +121,8 @@ func DeleteFilesystem() error {
logrus.Info("Deleting filesystem...")
return filepath.Walk(constants.RootDir, func(path string, info os.FileInfo, _ error) error {
if CheckWhitelist(path) {
if ! isExist(path) {
logrus.Debugf("Path %s whitelisted, but not exists", path)
if !isExist(path) {
logrus.Debugf("Path %s whitelisted, but not exists", path)
return nil
}
if info.IsDir() {
@ -141,7 +141,8 @@ func DeleteFilesystem() error {
return os.RemoveAll(path)
})
}
// isExists returns tru if path exists
// isExists returns true if path exists
func isExist(path string) bool {
if _, err := os.Stat(path); err == nil {
return true