>When people show how to accomplish that, you state 'well what about my test that doesn't need all three?'
You've phrased this as if I said this after I'd been given a solution for the initial problem. In reality, I mentioned this in the original post itself, but it seems many people didn't read it.
It's almost like I have prior real-world experience of this problem, where I already went down the path of making common functions for all the creation and cleanup respectively, only to find that it doesn't help when all the functions don't create the same subset of things.
Hey, I didn't mean to come across as rude but when I reread it, it was. I wasn't expressing myself well, I apologize.
I've been a Go mentor for years, and see how people take concepts they are used to and try to shoehorn them in, and complain they are ugly.
In this case, when I first saw your examples, my thought was 'youre doing it wrong'. But not wrong as in incorrect, but now how the language was designed.
If you truly care we can go through scenarios and I can tell you how I'd approach it. But in my past experience, when people find a paradigm they like, they tend to not listen.
You've phrased this as if I said this after I'd been given a solution for the initial problem. In reality, I mentioned this in the original post itself, but it seems many people didn't read it.
It's almost like I have prior real-world experience of this problem, where I already went down the path of making common functions for all the creation and cleanup respectively, only to find that it doesn't help when all the functions don't create the same subset of things.
>Why are you testing things your code doesn't do?
I have no idea how you came to this conclusion.