Read whole data with Golang net.Conn.Read
It highly depends on what you’re trying to do, and what kind of data you’re expecting, for example if you just want to read until the EOF you could use something like this: func main() { conn, err := net.Dial(“tcp”, “google.com:80”) if err != nil { fmt.Println(“dial error:”, err) return } defer conn.Close() fmt.Fprintf(conn, “GET … Read more