mirror of https://github.com/cheat/cheat.git
use filepath.Split
This commit is contained in:
parent
3d86b199ae
commit
70e1918f90
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue