-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explicitly set byte order in new #8
Comments
Compatibility instead of comparability 😁 |
Thanks for your advise. But I think use Semantic Versioning to handle this situation is a better idea. |
@sturfee-petrl @im7mortal So sorry for this issue. I will use Semantic Versioning later. |
I want to reassure you one more time. There are only 2 options LittleEndian or BigEndian. Like I told before 👉 go way is when code is ridiculously simple 👈. There no any clearance why it have LittleEndian by default. It's black box. 💥 There a lot of examples when New function have important explicit parameters in standard library.
LittleEndian and BigEndian are also encoding |
@im7mortal I'm think about this again and I think your idea is the correct solution. I'm a little busy these days, can you send a PR for this please? |
I spent all day to find this problem 😞. It was absolutely not obvious.
f1b53c4#commitcomment-24315680
Byte order is only one important option when you need work with binary. There are sense to add it directly to signature.
I propose explicitly add byte order to new functions. It's go way. It should be obvious.
I thought about NewPackerWithOrder but it's not good idea. binpacker single purpose package and it should be concise. SetByteOrder would be unused.
The text was updated successfully, but these errors were encountered: