将6个字节的片转换为小端

I want to convert a 6 byte slice to little Endian encoding.

I am parsing an array using byte slices and converting them to little Endian using The Read function of binary package. But When I parse a 6 byte slice e.g. {05,00,00,00,00,00} it returns zero (hex notation) with data interface being uint64. Is there any way to do this using the above function and not hardcoding it. Note that if I pad the residual two bytes zeros I get the result but somehow the my parser misses the following two bytes of the array.

Thanks for your help/suggestions.

Decode it by hand. It's trivial:

b := []byte{5,0,0,0,0,0,0}
i := uint64(b[0]) |
     uint64(b[1]) << 8 |
     uint64(b[2]) << 16 |
     uint64(b[3]) << 24 |
     uint64(b[4]) << 32 |
     uint64(b[5]) << 40