Skip to content

Commit 8f1eb8f

Browse files
committed
Diagnosing the serialization error in TestEventMessage_ReadStructured
Signed-off-by: MaryamTaj <[email protected]>
1 parent 04a0511 commit 8f1eb8f

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

v2/binding/to_event.go

-11
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"errors"
1313
"fmt"
1414
"io"
15-
"time"
1615

1716
"github.com/cloudevents/sdk-go/v2/binding/format"
1817
"github.com/cloudevents/sdk-go/v2/binding/spec"
@@ -139,16 +138,6 @@ func (b *messageToEventBuilder) SetAttribute(attribute spec.Attribute, value int
139138
}
140139
return nil
141140
}
142-
143-
// Check if the attribute is 'time' and set it correctly
144-
if attribute.Kind() == spec.Time {
145-
t, ok := value.(time.Time)
146-
if !ok {
147-
return fmt.Errorf("expected time.Time for 'time' attribute, got %T", value)
148-
}
149-
return attribute.Set(b.Context, t)
150-
}
151-
152141
return attribute.Set(b.Context, value)
153142
}
154143

0 commit comments

Comments
 (0)