On Mon, Nov 21, 2022 at 9:57 AM Nikhilesh Susarla
<
nikhil...@gmail.com> wrote:
> I have an int64 value say 12
> I want to convert that to []byte array.
Such conversion is not supported. Also, []byte is a slice.
However, the desired result can be computed in code. You can use the
encoding/binary package for that. Endianness matters, you cannot avoid
choosing one or another as that selects different results. In some
contexts the right endianness is platform independent, like in many
network/serialization protocols. In some other cases one has to follow
the platform endianness.
HTH.