I have this code:
hashChannel <- []byte(md5.Sum(buffer.Bytes()))
And I get this error:
cannot convert md5.Sum(buffer.Bytes()) (type [16]byte) to type []byte
Even without an explicit conversion, this does not work. I can also store a byte like [16], but at some point I need to convert it, since I am sending it over a TCP connection:
_, _ = conn.Write(h)
What is the best way to convert it? Thanks
slice go
Michael
source share