Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Go] advice about testing/synctest #870

Open
Carrotman42 opened this issue Dec 22, 2024 · 0 comments
Open

[Go] advice about testing/synctest #870

Carrotman42 opened this issue Dec 22, 2024 · 0 comments

Comments

@Carrotman42
Copy link
Collaborator

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant