lunixbochs / struc

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

can do two-stage decoding with less reflection and more safety #50

Open lunixbochs opened 7 years ago

lunixbochs commented 7 years ago

this could be a moderate rewrite

  1. unpack a type based on the cached type, this might be a function pointer like FieldType.Unpack()
  2. use argjoy-style type switching (including perhaps argjoy's IntToInt), with error checking to convert the resulting unpacked values