I am connecting to a TCP/IP server using Go code similar to:
conn, err := net.Dial("tcp", host+":"+strconv.Itoa(port))
Now I need to use binary.ReadVariant which takes an io.ByteReader, so trying to write code like this:
var length int64
var err error
length, err = binary.ReadVarint(conn)
Gives me an error like:
./main.go:67: cannot use conn (type net.Conn) as type io.ByteReader in function argument:
net.Conn does not implement io.ByteReader (missing ReadByte method)
How can I make this work?