a2800276 <a2800...@gmail.com> wrote: > I agree it has no technical merit. It can't do better, but it avoid having > to think about the type mismatch. The functionality provided by ByteOrder > is fairly simple to begin with, I assume its whole purpose is to reduce > cognitive load/avoid dumb mistakes. My assumption is that it's probably not > immediately obvious to everyone whether `a := int64(unsigned_value)` never > loses precision or never reinterprets/reorders the physical value of the > bytes. At least I had to stop and think about it and the benefit of a > things like ByteOrder would be not having to think :) Then again, I'm not > particularly bright. >
This binary package provides Varint (see go doc) encoded integer which detects overflows. This may help with dumb mistakes if it's easy to switch to its encoding format. BR. -w -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/2V3MSWQ2PN88O.3EBUXVQXTJI41%40104d.net.