From 3c35d36b0ed3c990a188cd437565a47711f10b6c Mon Sep 17 00:00:00 2001 From: MaryamTaj Date: Sun, 29 Sep 2024 17:49:41 -0400 Subject: [PATCH] Diagnosing the serialization error in TestEventMessage_ReadStructured Signed-off-by: MaryamTaj --- v2/binding/to_event.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/v2/binding/to_event.go b/v2/binding/to_event.go index 1c73b3c5b..d3332c158 100644 --- a/v2/binding/to_event.go +++ b/v2/binding/to_event.go @@ -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" @@ -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) }