Skip to content

[Go] advice about testing/synctest #870

@Carrotman42

Description

@Carrotman42

Reference: golang/go#67434

In the cases where it is necessary for testing, historically (inside Google) gophers have been advised to pass around values such as func() time.Time, or some similar fake-able clock, instead of calling time.Now(). With synctest it seems like a new strategy is to simply rely on the new primitives rather than bothering with that plumbing.

Does the Google Go style guide have an opinion on this?

(@matttproud @gaal)

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:goThe Go language

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions