4 ms·
Like I said elsewhere in the thread, you can have the same problem with callbacks: func receiver(next func() bool, getItem func() Foo) {} vs type Foo
by throwaway894345 7y ago
Like I said elsewhere in the thread, you can have the same problem with callbacks:
func receiver(next func() bool, getItem func() Foo) {}
vs
type FooIter interface { Next() bool; Item() Foo }
func receiver(iter FooIter) {}
You're more likely to pass the wrong set of callbacks than to pass the wrong FooIter implementation since the type system doesn't require the callbacks to be related to the same data nor named any certain way.
- lmm 7y agoReplied elsewhere.