Skip to content

Instantly share code, notes, and snippets.

@ttlins
ttlins / reader.go
Last active April 15, 2019 19:32 — forked from jmackie/reader.go
Pass a single io.Reader to multiple goroutines
/*
Package fan is a little concurrent io experiment.
Example Use Case
----------------
You have a function that takes a single io.Reader as an argument. You would like
to pass that reader to several processing functions. You could just make the
function accept an io.ReadSeeker, invoke each function serially in a for loop,
seeking after each call. But that's not cool.