title: Golang port blocking (?) using http.ListenAndServe
body: <p>I have a simple golang program which listens for activity on a port before executing a function called <em>testFunc</em></p>
  
  <pre><code>func main() {
      http.HandleFunc("/test", testFunc)
      http.ListenAndServe(":1337", nil)
  }
  </code></pre>
  
  <p>When I build this program, run it and go to <a href="http://localhost:1337/test" rel="nofollow">http://localhost:1337/test</a>, it works fine. </p>
  
  <p>When I terminate the program and try and run it again, the program instantly terminates showing no error output.</p>
  
  <p>When I then change the port to 1338 for example, it works the first time, then fails each time after. Any ideas?</p>