title: Read data from a UDP socket with an unknown length
body: <p>How could I <code>socket.ReadFromUDP</code> without knowing the length beforehand? Right now I have something like this.</p>
  
  <pre><code>buff := make([]byte, &lt;unknownLength&gt;)
  for {
      socket.ReadFromUDP(buff)
      fmt.Println("Bytes read:", buff.Len())
  }
  </code></pre>
  
  <p>I tried this, but it always read 1024 bytes.</p>
  
  <pre><code>buff := make([]byte, 1024)
  for {
      bytesRead, _, _ := socket.ReadFromUDP(buff)
      fmt.Println("Bytes read:", bytesRead)
  }
  </code></pre>
  
  <p>The packets I'm receiving from the server vary from a couple of bytes to hundres of bytes.</p>