3 ms·
I don't get the part on package. Often you want to use structs. (Instance vs static) How would you construct an instance in a test that needs mock implementati
by stpedgwdgfhgdd 2y ago
I don't get the part on package. Often you want to use structs. (Instance vs static)
How would you construct an instance in a test that needs mock implementations?
- roncesvalles 2y agoSuch an instance would just be a variable somewhere that would be initialized in some init() call when the program starts. Every user of that instance will use it directly (as opposed to storing a reference to it locally DI style).
- gf000 2y agoSo global mutable state? How wonderfully modern!