AlexanderGrom/go-patterns

About Singleton

expproletariy opened this issue · 2 comments

I think, the singleton type name must begin with a lowercase letter, we need to create instance only by GetInstance() func. Thanks!

In this case, you will see:
[go-lint] exported func GetInstance returns unexported type *singleton, which can be annoying to use.

So in reality it is better to return the interface.

Thanks for response! Now I understand your decision.