It is a Go best practice to "accept interfaces, return concrete types". 
Which helps greatly in implementing different architectures/designs (like 
Clean Architecture or the like).

There are times that a package is used which returns fat structs (as the 
concrete type) - mostly POGO.

Problem:
Redefining some domain models for those payloads is cumbersome and 
sometimes impractical. At the same time using them directly, exposes other 
packages to that package that we want to abstract out it's functionality. 
Some unwelcome dependency.

Question:
Should we redefined all those data types in upper layers for using them? If 
no what is the solution?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to