Browse Source

241101-2138-Kim

EricKIm 3 weeks ago
parent
commit
4cda58cf77
1 changed files with 5 additions and 0 deletions
  1. 5 0
      etc/string.go

+ 5 - 0
etc/string.go

@@ -158,3 +158,8 @@ func StructToMap(in interface{}, tag string) (map[string]interface{}, error) {
 	}
 	return out, nil
 }
+func FileNameFromPath(input string) string {
+	result := strings.ReplaceAll(input, "\\", "/")
+	parts := strings.Split(result, "/")
+	return parts[len(parts)-1]
+}