Re: [go-nuts] binary.ByteOrder

2023-08-10 Thread TheDiveO
https://github.com/google/nftables/blob/main/binaryutil/binaryutil.go ... could give you some bad ideas; we need it for Linux nftables that encodes stuff in host endianess. On Thursday, August 10, 2023 at 3:27:49 PM UTC+2 Stephen Illingworth wrote: > Thanks. Although I'm not worried about the n

Re: [go-nuts] binary.ByteOrder

2023-08-10 Thread Stephen Illingworth
Thanks. Although I'm not worried about the native byte order of my machine I'm writing an ARM emulator. The endianness of the ARM I'm taking to be whatever the endianess is in the ELF file from which I'm loading the program. I'm using the debug/elf package in the standard library which in turn

Re: [go-nuts] binary.ByteOrder

2023-08-10 Thread Rob Pike
First read https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html then see https://go.dev/play/p/4ESm6nOwgtY -rob On Thu, Aug 10, 2023 at 8:46 PM Stephen Illingworth < stephen.illingwo...@gmail.com> wrote: > Hello, > > I want to detect the implementation of binary.ByteOrder. i

[go-nuts] binary.ByteOrder

2023-08-10 Thread Stephen Illingworth
Hello, I want to detect the implementation of binary.ByteOrder. ie. whether it is Little Endian or Big Endian. Normally, you would do this with a type assertion or a type switch but in the case of the binary package the little/big endian implementations are not exported. The only way that I c