Re: [go-nuts] Using variadic function / context in an interface?

2018-04-27 Thread nimrodshn
Hey rog, Thanks for the reply! What happens now - I have an Init method for each struct implementing Runner, the Init method is not in the interface and I have to do type assertion every time I call to Init - That is for each class implementing the Runner interface. It's a bit ugly in my POV Bu

[go-nuts] Re: Using variadic function / context in an interface?

2018-04-27 Thread nimrodshn
I mean, it doesn't have to be I just find that it is more cleaner... What happens now - Init is not in the interface and I have to do type assertion every time I call to Init - That is for each class implementing the Runner interface. It's a bit ugly in my POV But I can live with it.. On Thurs

[go-nuts] Using variadic function / context in an interface?

2018-04-26 Thread nimrodshn
Hey everyone, I've encountered a design issue - I have an the following interface - type Runner interface { Run(x X,y Y) } I want to add to it an Init(...) method which will initialize the internal fields of the Runner before performing `Run`.. My issue is that different structs implementing