From: Mark Wooding Date: Mon, 1 Apr 2013 15:22:03 +0000 (+0100) Subject: go-fringe.go: Language change: `closed' function on channels has gone. X-Git-Url: https://git.distorted.org.uk/~mdw/fringe/commitdiff_plain/8a4f4f075a6e2e90039b172242097a4eca48d60b?hp=e13b0c79e810c1e82ee394049e50dc802acab1ad go-fringe.go: Language change: `closed' function on channels has gone. Replaced by a two-valued `<-' read operator, which does exactly what we want. --- diff --git a/go-fringe.go b/go-fringe.go index 70e23b5..d79760e 100644 --- a/go-fringe.go +++ b/go-fringe.go @@ -52,9 +52,8 @@ func MakeIterator(it Iterable) Iterator { // Returns the next item from an iterator IT. If there is indeed an item // available, return it and true; otherwise return nil and false. func (it Iterator) Next() (any, bool) { - item := <-it; - if closed(it) { return nil, false; } - return item, true; + item, anyp := <-it; + return item, anyp; } // Answer whether the iterators return the same items in the same order.