From cb5d484ec08842aa51d97a42108191abfe8d7581 Mon Sep 17 00:00:00 2001 From: xxjwxc Date: Fri, 22 May 2020 01:55:27 +0800 Subject: [PATCH] Update myfile.go --- myfile/myfile.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/myfile/myfile.go b/myfile/myfile.go index d2adca5..1dc4274 100644 --- a/myfile/myfile.go +++ b/myfile/myfile.go @@ -3,14 +3,15 @@ package myfile import ( "fmt" "path" + "strings" "time" "github.com/xxjwxc/public/tools" ) // GetExp 获取字符串后缀 -func GetExp(exp string) string { - return path.Ext(exp) //获取文件后缀 +func GetExp(ext string) string { + return strings.TrimLeft(path.Ext(ext), ".") } func getFileName(exp string) string {