On 18 October 2012 20:22, Dumitru Ungureanu <
itmi...@gmail.com> wrote:
> Is this addressing the idiomatic part too?
>>
http://play.golang.org/p/GAI9_1kmfT
Well. If you have some data you want to modify with a function,
storing that data in a struct and defining the function as a method is
indeed idiomatic. Using interface values of non-exported types is also
quite idiomatic.
It is quite possible that a closure or a global variable is a better
option to solve your problem but defining types and methods may help
you to structure your package better, depending on your particular
case. Usually, the most idiomatic solution is the simplest one.