use filepath.Split

This commit is contained in:
lengyijun 2020-09-01 20:06:17 +08:00
parent 3d86b199ae
commit 70e1918f90
1 changed files with 1 additions and 2 deletions

View File

@ -90,8 +90,7 @@ func Load(cheatpaths []cp.Cheatpath) ([]map[string]sheet.Sheet, error) {
}
func sameNameToParentDir(path string) (string, bool) {
fileName := filepath.Base(path)
dir := filepath.Dir(path)
dir, fileName := filepath.Split(path)
parDir := filepath.Base(dir)
if parDir == fileName {
return strings.TrimSuffix(strings.TrimSuffix(path, fileName), string(os.PathSeparator)), true