fix: issues

This commit is contained in:
Rogee
2024-12-10 10:24:31 +08:00
parent 0c9cb498d5
commit cb1cdee87e
32 changed files with 226 additions and 61 deletions

View File

@@ -2,6 +2,8 @@ package path
import (
"os"
"path/filepath"
"strings"
"github.com/pkg/errors"
)
@@ -35,3 +37,10 @@ func DirExists(path string) bool {
}
return st.IsDir()
}
func SplitNameExt(name string) (string, string) {
ext := filepath.Ext(name)
name = name[:len(name)-len(ext)]
return name, strings.TrimLeft(ext, ".")
}