---
title: "masood keshvari (@masoodkeshvari) | Hashnode"
description: "Backend developer | Golang. Read the latest articles by masood keshvari on Hashnode."
url: "https://hashnode.com/@masoodkeshvari"
---

@masoodkeshvari

# masood keshvari

@masoodkeshvari · Joined January 2024

Backend developer | Golang

## Comments

[Hi and thanks for sharing. I think bether to return Person struct in Clone() method instead of Interface. I saw many example that return interface. would you like to describe why return Interface?](https://hashnode.com/posts/golang-prototype-pattern/6406e928fbcc00f5f8900302/comment/65bbbfae218f292b04f2d89b)

Comment · Article · Feb 1, 2024 · [Golang - Prototype Pattern](https://hashnode.com/posts/golang-prototype-pattern/6406e928fbcc00f5f8900302)

[Hi and thanks to share this blog post. I have two questions: 1) In this example, you use private variable, why you don't expose it? in other word what difference between exposed and unexposed variable in this pattern? In my opinion when we expose it, other pkg can use it with nil value and as a result the application panics. is that the reason we use unexposed variable? 2) what happening if we don't expose type Singleton? In this example Singleton type is exposed, other pkg can create instance from Singleton type directly and as a result we have many instance from Singleton type. thanks Matthias](https://hashnode.com/posts/golang-singleton-pattern/64059e2d6170db39b922a784/comment/65ba2ae890e969cc2437d4c9)

Comment · Article · Jan 31, 2024 · [Golang - Singleton Pattern](https://hashnode.com/posts/golang-singleton-pattern/64059e2d6170db39b922a784)
