Skip to content

cmpopts: add EquateApproxDuration #394

@notchairmk

Description

@notchairmk

#155 added the ability to provide a margin for comparing time.Time, but some projects have needed to define their own custom comparers to handle margins for duration comparisons. It seems like it occurs enough to potentially be nice to add a new EquateApproxDuration opt.

Some examples:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions