News for hackers. Stuff that matters.
Re:Is Go Duck-Typed? by throwaway894345 on Thursday March 05, 2020 @11:42AM (#22495181)
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.
Re:Is Go Duck-Typed? by lmm on Thursday March 05, 2020 @06:38PM (#22499609)
Replied elsewhere.