Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: compare legacy event timestamps by value instead of format (#50)
Legacy event timestamp validation was done by string comparison, but this requires each language to format the timestamp in the same way. In Go, sub-second precision isn't always included [1]; in the test events the seconds field is 0 but is written with sub-second precision. It's not feasible to change the marshalling of timestamps in the Go test function, so instead we'll compare timestamps by their value. They're parsed as RFC3339 timestamps, so validation will still fail if the format is totally wrong, but this affords some leniency in the formatting. [1] From https://golang.org/pkg/time/#Time.MarshalJSON: "The time is a quoted string in RFC 3339 format, with sub-second precision added if present."
- Loading branch information