feat: adds unit tests for the object HEAD and GET controllers.

This commit is contained in:
niksis02
2025-07-22 20:55:22 +04:00
parent 67d0750ee0
commit ba76aea17a
5 changed files with 1042 additions and 33 deletions
+6
View File
@@ -677,6 +677,9 @@ func GetStringPtr(str string) *string {
// Converts any type to a string pointer
func ConvertToStringPtr[T any](val T) *string {
str := fmt.Sprint(val)
if str == "" {
return nil
}
return &str
}
@@ -694,6 +697,9 @@ func FormatDatePtrToString(date *time.Time, format string) *string {
if date == nil {
return nil
}
if date.IsZero() {
return nil
}
formatted := date.UTC().Format(format)
return &formatted