In Go, if I convert from a string -> []byte or conversely, from []byte -> string, could the data ever get corrupted. For example, let's say I've defined:
fooBytes := []byte(fooString)
fooConvertedBack := string(fooBytes
fooBytesConvertedBack := []byte(fooConvertedBack)
Then could we get a case where data gets corrupted such that:
fooString != fooConvertedBack
fooBytes != fooBytesConvertedBack
I'm guessing the answer here is no. I'm working with random arrays of bytes and I want to make sure that I won't corrupt data because, say for example, a golang string has a default character set which doesn't allow for completely random bytes.
Is it better to base64 encode the bytes?