Let's us say I have a package which contains different types of TV structs. Now, based on the parameters passed I would like to return a specific TV type.
How is it possible to return the specific type without using the interface type TV in the return type.
Another example, let us say I want to implement different kinds of
io.Writer but parallel network writers in a package say network_writers. Do I have just have to have another interface specific for parallel writers to come close to "Accept interfaces, return structs"?
I'm having hard time coming up with a good solution to this problem. While thinking this through I also have a trouble of whether to make this package private or not.