mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-08 09:38:16 +00:00
ce3384cd34
In the v1 implementation, unknown MessageSet items are stored in a message's unknown fields section in non-MessageSet format. For example, consider a MessageSet containing an item with type_id T and value V. If the type_id is not resolvable, the item will be placed in the unknown fields as a bytes-valued field with number T and contents V. This conversion is then reversed when marshaling a MessageSet containing unknown fields. Preserve this behavior in v2. One consequence of this change is that actual unknown fields in a MessageSet (any field other than 1) are now discarded. This matches the previous behavior. Change-Id: I3d913613f84e0ae82481078dbc91cb25628651cc Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/205697 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
19 lines
469 B
Protocol Buffer
19 lines
469 B
Protocol Buffer
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
syntax = "proto2";
|
|
|
|
package goproto.proto.messageset;
|
|
|
|
option go_package = "google.golang.org/protobuf/internal/testprotos/messageset/messagesetpb";
|
|
|
|
message MessageSet {
|
|
option message_set_wire_format = true;
|
|
extensions 4 to max;
|
|
}
|
|
|
|
message MessageSetContainer {
|
|
optional MessageSet message_set = 1;
|
|
}
|