DEV Community

Discussion on: Go, Kafka and gRPC clean architecture CQRS microservices with Jaeger tracing πŸ‘‹πŸ§‘β€πŸ’»

Collapse
 
tudorhulban profile image
Tudor Hulban

hi,
is

var created models.Product
Enter fullscreen mode Exit fullscreen mode

really needed? anyway you pass a pointer to the function.
why create another variable when you can write into the passed *models.Product?

Collapse
 
aleksk1ng profile image
Alexander

Hi, it’s up to you, depends on what you need, in this example, right yes we can reuse pointer like in other methods returning product dto, or may be in other case need return another dto, like in postgres we store id as uuid but want return id as string and etc. only id or only error :)