chore: upgrade dependencies

This commit is contained in:
Elias Schneider
2025-10-24 12:14:19 +02:00
parent 10d640385f
commit 6362ff9861
15 changed files with 1488 additions and 1585 deletions

View File

@@ -3,6 +3,7 @@ package utils
import (
"encoding/json"
"errors"
"fmt"
"time"
)
@@ -40,3 +41,14 @@ func (d *JSONDuration) UnmarshalJSON(b []byte) error {
return errors.New("invalid duration")
}
}
func UnmarshalJSONFromDatabase(data interface{}, value any) error {
switch v := value.(type) {
case []byte:
return json.Unmarshal(v, data)
case string:
return json.Unmarshal([]byte(v), data)
default:
return fmt.Errorf("unsupported type: %T", value)
}
}