Re: [go-nuts] Re: How to mock functions in Go ?

2019-08-03 Thread Andrey Tcherepanov
what if you need only a subpart of the package to be mocked ? On Thursday, August 1, 2019 at 5:29:30 PM UTC+3, Robert Engels wrote: > > That brings up an interesting idea. A ‘package replace’ during compile. So > you request that the os package is replaced by osmock etc. > > This would allow eas

Re: [go-nuts] Generics Draft: Mixing types and methods.

2019-08-03 Thread Steven Blenkinsop
On Sat, Aug 3, 2019 at 2:11 AM, Ian Lance Taylor wrote: > You're right, I wrote it wrong. Actually I'm not sure how to write that > contract. Ideally we want to say that T is either comparable or has the > Equal(T) bool method, but there is no way to write that. We can embed > comparable(T), b