In Golang if I have a byte array of binary data how do I determine the termination of actual data if it is in a larger array. For example if I do the following, reading a file when it is plain text:
chunk := make([]byte, 1024)
..read some data into the chunk but only 10 bytes are filled from the file...
I can then determine the actual size of the data by doing the following:
n := bytes.IndexByte(chunk, 0)
When it is plain text n will give me the end of the actual data - how do I do that if the data is binary?