feature: refactoring

master
amorozov 2024-06-21 18:44:26 +03:00
parent 6019beffe5
commit e85baa72f6
3 changed files with 13 additions and 11 deletions

View File

@ -3,7 +3,6 @@ package files
import ( import (
"errors" "errors"
"os" "os"
"strings"
) )
func IsFileExists(fileLocation string) bool { func IsFileExists(fileLocation string) bool {
@ -13,13 +12,3 @@ func IsFileExists(fileLocation string) bool {
return true return true
} }
func GetParentDir(fileLocation string) string {
fileLocation = strings.ReplaceAll(fileLocation, "\\", "/")
indexOfSlash := strings.LastIndex(fileLocation, "/")
if indexOfSlash > 0 {
return fileLocation[:indexOfSlash]
}
return ""
}

View File

@ -0,0 +1,13 @@
package files
import "strings"
func GetParentDir(fileLocation string) string {
fileLocation = strings.ReplaceAll(fileLocation, "\\", "/")
indexOfSlash := strings.LastIndex(fileLocation, "/")
if indexOfSlash > 0 {
return fileLocation[:indexOfSlash]
}
return ""
}