Add: shortuuid check, new date layout found

This commit is contained in:
Yoann La Cancellera
2023-10-20 11:42:43 +02:00
committed by Sveta Smirnova
parent 3eaf60bd88
commit 580ccb7428
2 changed files with 4 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ import (
var DateLayouts = []string{
"2006-01-02T15:04:05.000000Z", // 5.7
"2006-01-02T15:04:05.000000-07:00", // 5.7
"2006-01-02T15:04:05Z", // found in some crashes
"060102 15:04:05", // 5.5
"2006-01-02 15:04:05", // 5.6
"2006-01-02 15:04:05", // 10.3, yes the extra space is needed

View File

@@ -110,6 +110,9 @@ func StringsReplaceReversed(s, old, new string, n int) string {
func UUIDToShortUUID(uuid string) string {
splitted := strings.Split(uuid, "-")
if len(splitted) != 5 {
return uuid
}
return splitted[0] + "-" + splitted[3]
}