Re: [go-nuts] Re: Namespacing hack using method on empty type

2016-08-05 Thread Christoph Berger
Hi Christian, You’re right on this, but my question is about another aspect. The thread starter’s question was about using structs for namespaces (instead of packages). My question is, why would someone want to use empty structs for creating a name space if a package already does this. After

[go-nuts] Re: Namespacing hack using method on empty type

2016-08-05 Thread Christian Joergensen
Hi, For starters, packages can't implement interfaces. Cheers, On Friday, August 5, 2016 at 6:19:31 AM UTC+2, Christoph Berger wrote: > > Are there any advantages over using real packages? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Namespacing hack using method on empty type

2016-08-04 Thread Christoph Berger
Are there any advantages over using real packages? -- 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,

[go-nuts] Re: Namespacing hack using method on empty type

2016-08-04 Thread dc0d
Personally I do that (despite that everyone advocates against it). Just remember your struct should be just "struct{}" and nothing else. This helped me to use shorter & cleaner names for my functions - actually it converts a function pile to a batch of functions). On Wednesday, August 3, 2016