Cheers
Dave
Sent from my iPad
Well, since it's encoding/binary, I'm guessing that he's already
either specifying BigEndian or LittleEndian.
A better question, I think, is why int64 and not int32, uint64, or
uint32? If I was going to pick one, though, I'd use the varint
encoding, instead of a fixed width encoding:
http://code.google.com/p/snappy-go/source/browse/varint/varint.go
actually it does not - encoding/binary has only functionality to store
fixed sizes (for example int16, uint32) but not int.
it's for that reason that it's not a good idea to store strings indexes - they
are not fixed size values.
as for nigel's suggestion to use varint, i don't think that would be
in the spirit of the encoding/binary package which currently
uses all fixed-size values - important for some applications,
for instance when writing random-access data.
it might be nice to have a package that supported extensible
non-type-tagged data encoding, but i'm not sure that encoding/binary is the
right place for that.
BTW, what did you do about binary.TotalSize ?
Because there is not one obvious encoding,
as evidenced by the remainder of this thread.
Russ
In that case I think using something like the json packages rawmessage api would be appropriate.
--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.