News for hackers. Stuff that matters.
Re:One Year After Switching from Java to Go: Our Experiences by stpedgwdgfhgdd on Wednesday February 19, 2025 @02:59AM (#43099767)
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?

Re:One Year After Switching from Java to Go: Our Experiences by roncesvalles on Wednesday February 19, 2025 @03:04AM (#43099791)
Such 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).
Re:One Year After Switching from Java to Go: Our Experiences by gf000 on Wednesday February 19, 2025 @05:48AM (#43100732)
So global mutable state? How wonderfully modern!