Skip to content

Commit

Permalink
Diagnosing the serialization error in TestEventMessage_ReadStructured
Browse files Browse the repository at this point in the history
Signed-off-by: MaryamTaj <tajm48822@gmail.com>
  • Loading branch information
MaryamTaj authored and duglin committed Oct 31, 2024
1 parent ebf4c23 commit 3c35d36
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions v2/binding/to_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"errors"
"fmt"
"io"
"time"

"github.com/cloudevents/sdk-go/v2/binding/format"
"github.com/cloudevents/sdk-go/v2/binding/spec"
Expand Down Expand Up @@ -139,16 +138,6 @@ func (b *messageToEventBuilder) SetAttribute(attribute spec.Attribute, value int
}
return nil
}

// Check if the attribute is 'time' and set it correctly
if attribute.Kind() == spec.Time {
t, ok := value.(time.Time)
if !ok {
return fmt.Errorf("expected time.Time for 'time' attribute, got %T", value)
}
return attribute.Set(b.Context, t)
}

return attribute.Set(b.Context, value)
}

Expand Down

0 comments on commit 3c35d36

Please sign in to comment.