<p dir="auto">by <strong>blake.mizerany</strong>:</p>
<pre class="notranslate">Per email from Brad:

It looks like what you don't actually care about owning the TCP connection and ideally
just want something like:

 var clientClosed chan bool
 cn, ok := w.(http.CloseNotifier)
 if ok {
     clientClosed = cn.CloseChannel() // returns a chan bool, written to when/if this http request is closed
 }

 select {
  case &lt;-clientClosed:
     // cancel expensive stuff
  case ....
  }

<a href="https://groups.google.com/d/topic/golang-nuts/PcEvewBB-AQ/discussion" rel="nofollow">https://groups.google.com/d/topic/golang-nuts/PcEvewBB-AQ/discussion</a></pre>
<pre class="notranslate">The current testing package documentation states:

"These TestXxx routines should be declared within the package they are
testing."

There's no mention of the commonly used technique of creating a file with 

package foo_test

instead of 

package foo

for blackbox or example purposes.</pre>