[Go] advice about testing/synctest
Open
lang:go
- Dominant language
- HTML
- Stars
- 39.6k
- Forks
- 12.9k
- Avg merge
- 42m
- Merged PRs (30d)
- 15
Description
Reference: https://github.com/golang/go/issues/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)
Contributor guide
Assessment
This issue has not been assessed yet.