Fix binary encoding

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-09 11:16:07 +01:00
parent bf49c825c4
commit 5954414959

View File

@@ -58,12 +58,14 @@ func (s EmailStatus) String() string {
}
func (s *EmailStatus) Scan(value any) error {
val, ok := value.(string)
if !ok {
return fmt.Errorf("invalid scan source for EmailStatus, expected string got %T", value)
switch v := value.(type) {
case string:
return s.UnmarshalText([]byte(v))
case []byte:
return s.UnmarshalText(v)
default:
return fmt.Errorf("invalid scan source for EmailStatus, expected string or []byte got %T", value)
}
return s.UnmarshalText([]byte(val))
}
func (s EmailStatus) Value() (driver.Value, error) {