New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proto3 map support for C# #543
Proto3 map support for C# #543
Conversation
More tests required. Generated code in next commit.
Generated code in next commit.
(Primarily this is starting the hash code of messages at a non-zero value...)
- Change the default message hash code to 1 to be consistent with other code - Change the empty list/map hash code to 0 as "empty map" is equivalent to "no map" - Removed map fields from unittest_proto3.proto - Created map_unittest_proto3.proto which is like map_unittest.proto but proto3-only - Fixed factory methods in FieldCodec highlighted by using all field types :) - Added tests for map serialization: - Extra fields within entries - Entries with value then key - Non-contiguous entries for the same map - Multiple entries for the same key Changes to generated code coming in next commit
I've made the requested changes from #544 - I've added all the relevant tests I can think of, and the coverage looks pretty good... are there any other tests you'd like before I merge this? (I haven't rebased the cleanup work yet - I'll do that when I merge this.) |
Just found another bug with FieldCodec - will write significant tests for this before merging... |
Okay, with the fix to FieldCodec (and some tests for it, finally :) I think I'm happy with this again. |
I went through the code and LGTM (ex-post, because it's already been merged). |
) Rework the handling of imported packages. Do not add imported protobuf packages to a global registry. Instead, maintain a per-file list of packages and names. This avoids imports in one file affecting the generated code in a second one. Consistently deal with imports in terms of import path, rather than source file. This avoids imports of two .proto files in the same Go package producing redundant import statements. Introduce ImportPath and PackageName types to prevent confusion about which values contain import paths ("github.com/golang/protobuf/proto") and which contain package names ("proto"). Convert many uses of FileDescriptorProto to FileDescriptor, for consistency and general convenience.
Fixes for google3 (layering check and formatting).
There are still some open questions about handling strings and ByteStrings, but this is a good first step.