Dec 13, 2023
I believe at this point there is no wrong answer I had witnessed some senior engineers using a seperate map and use only one instance other using sync.once to make singleton others prefer your manner, and of course I prefer mine.
I can say I tried all of them btw, and this is suitable for all cases.