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 at 7:37:35 PM UTC+4:30, atd...@gmail.com wrote: > > No it can have its uses. > > It really depends on what you are doing. However, I've never done this as > a way to declare some kind of namespace. > > Typically, I use that in testing when I want a dummy type to implement an > interface. > > That's just an example. > > It can be used also if you export the struct type. That allows to transfer > a group of functions (closer to your idea of namespace). > Instead of exporting each function separately. > -- 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.