Re:Mocking time and testing event loops in Go
by cmwelsh on Monday May 25, 2020 @07:12AM
(#23299930)
I am using java.time.Clock class in Java - really similar to what’s mentioned for Go in the article! It works great and enables us to write reliable, comprehensive, reproduce-able unit tests.
[ Parent
| on HN ]
Re:Mocking time and testing event loops in Go
by oftenwrong on Monday May 25, 2020 @07:42AM
(#23300076)
Same here. Any code that references the current time gets it from a Clock parameter.