fix: issues
This commit is contained in:
@@ -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, ".")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user