Open fritzr opened 1 year ago
This seems like a mistake to me, it should probably be possible. Feel free to submit a PR!
edit: Though, interestingly, it also seems to be omitted from encoding/binary
as well, unless I misunderstand. So, maybe it's not so clear-cut. Nonetheless, I think it's possibly more surprising that it doesn't work at all without any obvious output. This is tricky though, because implementing this either way (error message, or treating it like u/int64) will break compatibility with existing behavior AND encoding/binary. Tricky.
Unable to use
restruct.Pack
to pack anint
oruint
. See:The result of which is:
See https://go.dev/play/p/I7SFt1XI7nU.
The problem appears to be with the switch at encoder.go:289 which omits the
reflect.Int
andreflect.Uint
cases and silently returns without touching the buffer.encoder.write
.I'm happy to submit a PR if you let me know which behavior is intended.