🎇 md5 and filename

This commit is contained in:
微凉
2021-12-02 18:57:29 +08:00
parent 1d7d37e642
commit d81ec0637d
4 changed files with 17 additions and 9 deletions

View File

@ -105,4 +105,12 @@ func Dir(path string) string {
return path
}
return path[:idx]
}
func Base(path string) string {
idx := strings.LastIndex(path, "/")
if idx == -1 {
return path
}
return path[idx+1:]
}