增加获取文件扩展名的方法

This commit is contained in:
2024-06-18 11:54:51 +08:00
parent 1f58204e86
commit 8d48a6bd39
3 changed files with 15 additions and 2 deletions

View File

@ -284,3 +284,12 @@ func (f *file) ReadDirFileList(dirPath string, ignoreHiddenFile bool, isRecurve
func (f *file) ReadFileListRecurve(rootDir string) ([]*define.FileInfo, error) {
return nil, nil
}
// FileExt 获取文件后缀
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 11:53 2024/6/18
func (f *file) FileExt(filePath string) string {
return strings.TrimLeft(filepath.Ext(filePath), ".")
}