lunixbochs / struc

Better binary packing for Go
MIT License
564 stars 42 forks source link

Add native tag to use host byte order #69

Closed tmm1 closed 4 years ago

tmm1 commented 4 years ago

fixes #68

lunixbochs commented 4 years ago

Adding a dependency on unsafe means we can't run in sandboxed Go environments. I'd like to see if we can detect native byte order another way. You're also free to use the unsafe code in your own repository, and call PackWithOptions w/ the byte order option

tmm1 commented 4 years ago

call PackWithOptions w/ the byte order option

Aha, this is what I was missing! Thank you.

tmm1 commented 4 years ago

Looks like there's PackWithOrder too. I've opened #72 so its easier for others to discover the APIs available.

lunixbochs commented 4 years ago

I wanted to deprecate PackWithOrder, it's very similar to use PackWithOptions which also provides other options