diff --git a/commons/path.go b/commons/path.go index b00769f..0ac40ad 100644 --- a/commons/path.go +++ b/commons/path.go @@ -81,6 +81,9 @@ func GetFileExtension(p string) string { } func GetBasename(p string) string { + p = strings.TrimRight(p, string(os.PathSeparator)) + p = strings.TrimRight(p, "/") + idx1 := strings.LastIndex(p, string(os.PathSeparator)) idx2 := strings.LastIndex(p, "/")