Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix swap type assert to only call Size when Marshal is generated.
* added Sizer type assert at cachedsize method. The sizecache is not calculated if the struct conforms to the Sizer interface * fixed go vet issue. removed err variable shadowing * refactor pointer interface type conversion out in order to implement both reflect and unsafe cases * added minimal test example * added sizer option when computing the marshalinfo and generator now either use MarshalTo or default marhsaling. hassizer property now checked in the marshalinfo size method if the type has a Size() method. removed the Sizer interface check in the generated XXX_Size methods. * remove unnecessary variable and just return size. * added a check if the message have a protosize method. changed the size and cached size methods to just return the message size without looking at any other struct fields. * removed the sizer checks in the caching method. only use size mehtods of the message is also a marshaler * revert the bench result accidental update * do a generate time check for XXX_unmarshal.
- Loading branch information