I have a file (say the descriptor is named file) opened via the os.Open() method so I want to read its contents into a bytes array.
I assume the approach would be to create the later
data := make([]byte, 10000000)
and then read the contents into it
n, err := file.Read(data)
My question is whether there is a more elegant/go-idiomatic way of going about this since by not knowing in advance the file size, I just pass a number I estimate would do (10000000) upon initialisation of the bytes array.