code: func sendMessage(conn *net.TCPConn, data []byte) error {
  	length := int32(len(data))
  
  	buffer := bytes.NewBuffer(nil)
  	binary.Write(buffer, binary.BigEndian, length)
  
  	conn.SetWriteDeadline(time.Now().Add(time.Second * 10))
  	_, err := conn.Write(append(buffer.Bytes(), data...))
  	return err
  }
docs: // sendMessage sends data to the connection.