mirror of
https://github.com/versity/versitygw.git
synced 2026-08-20 06:06:19 +00:00
feat: adds unit tests for the object HEAD and GET controllers.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user