golang timing out reading from channel using range
<p>My code looks like this:</p>

<pre><code>outChannel := make(chan struct{})
...
for out := range outChannel {
   ...
}
</code></pre>

<p>I have a producer writing to <code>outChannel</code> and would like to timeout on reading from it (if overall processing takes more than XX seconds). 
What would be the proper way to do so? </p>

<p>As I've only seen construct (at: <a href="https://github.com/golang/go/wiki/Timeouts" rel="nofollow">https://github.com/golang/go/wiki/Timeouts</a>) using <code>select</code> with multiple <code>case</code>s reading from the channels, however, this seems not applicable once using <code>range</code>.</p>