News for hackers. Stuff that matters.
Re:The Beauty of Concurrency in Go by hornetblack on Sunday April 28, 2013 @09:29PM (#5623633)
You could save the future in the Future implementation

    type future struct {
        completed   bool
        result      interface{}
        ch        <-chan interface{}
    }
Edit: Or just check if the channel is closed

    func (f *future) Wait() interface{} {
        v, ok := <- ch
        if ok { f.result = v; return v }
        else  { return f.result }
    }

There are no comments on this comment yet.