On Sat, Mar 04, 2017 at 03:57:48PM -0800, mlg wrote: > 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.
Well, what is the defining characteristic that makes this type different from other implementations of the same interface? That's how you should approach the naming. Example: you're dealing with some kind of data-shoveling pipe (interface name: pipe). The networked variant is called netPipe while you use memPipe for the in-memory version used in testing. -- 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.