EricKIm 3 settimane fa
parent
commit
4cda58cf77
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  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]
+}