title: How to store websocket connection in GO
body: <p>I want to store client websocket connection into <code>wsList</code>, and send response in uniform. but it will return "use of closed network connection". How to fix it?  </p>
  
  <pre><code>import {
      "code.google.com/p/go.net/websocket" 
      ...
  }
  
  var wsList []*websocket.Conn
  
  func WShandler(ws *websocket.Conn) {
      wsList = append(wsList, ws)
      go sendmsg()
  }
  
  func sendmsg() {
      for _, conn := range wsList {
          if err := websocket.JSON.Send(conn, outmsg); err != nil {
              fmt.Printf("%s", err)   //"use of closed network connection"
          }
      }
  }
  </code></pre>