Re:Mocking time and testing event loops in Go
by EdSchouten on Tuesday May 26, 2020 @12:11AM
(#23307338)
Though that is true, remember that Go doesn’t support co/contravariance on interface types.
Defining interfaces around existing types works, but quickly falls apart as soon as methods return concrete types. In those cases you need to write more complex wrappers, which is often not worth the hassle.
Defining interfaces around existing types works, but quickly falls apart as soon as methods return concrete types. In those cases you need to write more complex wrappers, which is often not worth the hassle.