google / google/go-cmp

Race condition when using go-cmp on structs that include `time.Time`

Open
#381 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
4.7k
Forks
243
PR merge metrics
No merged PRs in 30d

Description

👋

This a follow-up to https://github.com/golang/go/issues/74460 in the golang issues tracker, where go present a data race when some of the private fields of time.Time are accessed trough the `reflect` package.

The Golang team decided not to fix the issue as it have implication on the maintainability of private fields in the standard library and suggested to fix `go-cmp` to treat `time.Time` as a special case and use `==` to compare time fields as that's the way go recommend comparing `time.Time` (read comments on https://github.com/golang/go/issues/74460 for more details).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.