Skip to content

Instantly share code, notes, and snippets.

@jonbodner
Last active August 24, 2017 17:01
Show Gist options
  • Save jonbodner/84e9a107f789f25978fba9fd2dee8c27 to your computer and use it in GitHub Desktop.
Save jonbodner/84e9a107f789f25978fba9fd2dee8c27 to your computer and use it in GitHub Desktop.
future-blog-post-5
type futureImpl struct {
done chan struct{}
val interface{}
err error
}
func (f *futureImpl) Get() (interface{}, error) {
<-f.done
return f.val, f.err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment