Skip to content

Commit

Permalink
breaking change: Serializing time to RFC-3339 using time.Time.Format()
Browse files Browse the repository at this point in the history
Signed-off-by: MaryamTaj <tajm48822@gmail.com>
  • Loading branch information
MaryamTaj committed Feb 24, 2024
1 parent 67e3899 commit a209c30
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions v2/event/event_marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"fmt"
"io"
"strings"
"time"

jsoniter "github.com/json-iterator/go"
)
Expand Down Expand Up @@ -76,7 +77,7 @@ func WriteJson(in *Event, writer io.Writer) error {
if eventContext.Time != nil {
stream.WriteMore()
stream.WriteObjectField("time")
stream.WriteString(eventContext.Time.String())
stream.WriteString(eventContext.Time.Format(time.RFC3339))
}
case *EventContextV1:
// Set a bunch of variables we need later
Expand Down Expand Up @@ -120,7 +121,7 @@ func WriteJson(in *Event, writer io.Writer) error {
if eventContext.Time != nil {
stream.WriteMore()
stream.WriteObjectField("time")
stream.WriteString(eventContext.Time.String())
stream.WriteString(eventContext.Time.Format(time.RFC3339))
}
default:
return fmt.Errorf("missing event context")
Expand Down

0 comments on commit a209c30

Please sign in to comment.