mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-30 03:32:49 +00:00
2040e8671b
This change adds the first Go specific editions feature and the associated proto. The feature is used to control if the legacy UnmarshalJSON method should be generated for enums. This change only affects protos using editions. More tests will be added in a followup change. Change-Id: Ifb62454d7568bd6d90d0b93f8953adcfe46c45fd Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/561938 Reviewed-by: Michael Stapelberg <stapelberg@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Lasse Folger <lassefolger@google.com>
29 lines
872 B
Protocol Buffer
29 lines
872 B
Protocol Buffer
// Protocol Buffers - Google's data interchange format
|
|
// Copyright 2023 Google Inc. All rights reserved.
|
|
//
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file or at
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
syntax = "proto2";
|
|
|
|
package google.protobuf;
|
|
|
|
import "google/protobuf/descriptor.proto";
|
|
|
|
option go_package = "google.golang.org/protobuf/reflect/protodesc/proto";
|
|
|
|
extend google.protobuf.FeatureSet {
|
|
optional GoFeatures go = 1002;
|
|
}
|
|
|
|
message GoFeatures {
|
|
// Whether or not to generate the deprecated UnmarshalJSON method for enums.
|
|
optional bool legacy_unmarshal_json_enum = 1 [
|
|
retention = RETENTION_RUNTIME,
|
|
targets = TARGET_TYPE_ENUM,
|
|
edition_defaults = { edition: EDITION_PROTO2, value: "true" },
|
|
edition_defaults = { edition: EDITION_PROTO3, value: "false" }
|
|
];
|
|
}
|