Skip to content

Commit

Permalink
Fix swap type assert to only call Size when Marshal is generated.
Browse files Browse the repository at this point in the history
* 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
jmarais authored and awalterschulze committed Jun 17, 2018
1 parent 28f30af commit 3557939
Show file tree
Hide file tree
Showing 139 changed files with 6,625 additions and 10,940 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ regenerate:
make -C test/issue330 regenerate
make -C test/importcustom-issue389 regenerate
make -C test/merge regenerate
make -C test/cachedsize regenerate
make gofmt

tests:
Expand Down
45 changes: 0 additions & 45 deletions conformance/internal/conformance_proto/conformance.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions jsonpb/jsonpb_test_proto/more_test_objects.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3557939

Please sign in to comment.