Go Golang net.Dial发送1个请求,但读取第二个响应

I am using Go to read a reply from a sever using net.Dial. The code below works but the server sends back 2 replys. To read the second reply I would have to read the reply again. Is there an easier way to discard the first reply and grab the second reply? Regards

_, err = conn.Write([]byte(login))
reply := make([]byte, 5000)

_, err = conn.Read(reply)
fmt.Print(string(reply))
io.CopyN(ioutil.Discard, conn, 5000)

it will read the first 5000 bytes and discard them. This is assuming each reply is exactly 5000 bytes though.

If the reply's are strings separated by new lines (such as http or irc), you could use buffio

reader := bufio.NewReader(os.Stdin)
reader.ReadString('
')
secondline := reader.ReadString('
')