Henry, according to your rationale, I believe the case I'm referring to is when the interface represents a domain object (e.g. Consumer). In such case, if you don't plan on exporting your interface (therefore naming it `consumer`), how would you name the implementing struct and why? If possible, define a general rule. That's my question. Sorry if I wasn't clear before.
On Saturday, 4 March 2017 23:00:51 UTC+13, Henry wrote: > > I believe there are two kinds of interface: one that represents a domain > object (eg. Consumer) and the other that represents a one or two methods > (eg. Stringer, ReadCloser). Typically, you use the first one when you use > interface to represent a data type. The second one is used when you need > only a subset of the object's methods (typically as an argument to a > function or method). > > For the first type, I use the normal domain name eg. Customer, Product, > etc. For the second type, I use the "-er" convention. > -- 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.