News for hackers. Stuff that matters.
Re:Singleton Pattern in Go by Lorento on Sunday July 12, 2015 @11:07PM (#9876158)
Just wondering what value the singleton provided if you only obtain it once. Isn't the purpose so you can obtain it whenever you want? If you just use a regular object, you run the risk of accidentally making another instance somewhere else, but you always have that risk with any regular object anyway.
Re:Singleton Pattern in Go by readme on Thursday July 16, 2015 @07:15PM (#9900444)
It's kind of OK to use, as long as you don't call it all over the place and render your code untestable such that it can't be mocked out, but I'm not a huge fan of it. It's really a matter of opinion at that point.