Thanks Dave!
Apologies for the broken code. I pasted from the wrong term.
So yes, I understand the signaling technique you've employed, but my original problem persists.
So if, for example, I added a time.Sleep to the handler function like so:
http://play.golang.org/p/ZzaB8y53DHThen sent ten or so lines to it via the shell like so:
echo 'line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10' | myprogram
I won't get any output because the inputHandler()'s will not have had a chance to finish before getInput() signals done.
So you see I'm looking for a way to signal both that there's no input (so the program doesn't deadlock on IO) and also that the handlers are all done (so we don't exit too early). Again I have a few notions of how I could do this, but they all seem... un-go-like to me given most the examples I've read so far.