protobuf-go/internal/impl
Joe Tsai 2d5a169f75 internal/impl: use linked-list for unknown field ordering
Unknown fields follow a policy where the latest field takes precedence when
it comes to the ordering. However, the current implementation is incorrect
as it uses a slice and simply swaps the current entry with the last entry.
While this ensures that the latest field seen remains last, it does not ensure
that the swapped out entry is second-to-last.

To provide the desired behavior, a linked-list is used.
For simplicity, we use the list package in the standard library even if it
is neither the most performant nor type safe.

Change-Id: I675145c61f6b5b624ed9e94bbe2251b5a71e2c48
Reviewed-on: https://go-review.googlesource.com/c/145241
Reviewed-by: Damien Neil <dneil@google.com>
2018-10-31 18:39:54 +00:00
..
legacy_enum.go internal/impl: derive descriptors for legacy enums and messages 2018-10-22 17:18:39 +00:00
legacy_file.go internal/impl: derive descriptors for legacy enums and messages 2018-10-22 17:18:39 +00:00
legacy_message.go reflect/protoreflect: add Descriptor.Options method 2018-10-23 23:44:11 +00:00
legacy_proto2_test.go internal/impl: derive descriptors for legacy enums and messages 2018-10-22 17:18:39 +00:00
legacy_proto3_test.go internal/impl: derive descriptors for legacy enums and messages 2018-10-22 17:18:39 +00:00
legacy_test.go internal/impl: use linked-list for unknown field ordering 2018-10-31 18:39:54 +00:00
legacy_unknown.go internal/impl: use linked-list for unknown field ordering 2018-10-31 18:39:54 +00:00
message_field.go internal/impl: implement oneof fields 2018-10-17 22:20:50 +00:00
message_test.go reflect/protoreflect: add Descriptor.Options method 2018-10-23 23:44:11 +00:00
message.go internal/impl: support legacy unknown fields 2018-10-26 19:55:21 +00:00
pointer_reflect.go internal/impl: support wrapping Go structs to implement proto.Message 2018-10-03 02:10:04 +00:00
pointer_unsafe.go internal/impl: support wrapping Go structs to implement proto.Message 2018-10-03 02:10:04 +00:00