Skip to content

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

@dhiaayachi

Description

@dhiaayachi

👋

This a follow-up to golang/go#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 golang/go#74460 for more details).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions