mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-01 03:14:16 +00:00
eba8b0975f
This change strips out all descriptor option fields marked with [retention = RETENTION_SOURCE] before writing the FileDescriptor to the generated go code bindings. Change-Id: Ie624d9d4b4f211a256661d80a04199ae8401662b Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/472696 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Lasse Folger <lassefolger@google.com>
30 lines
997 B
Protocol Buffer
30 lines
997 B
Protocol Buffer
// Copyright 2020 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 testretention;
|
|
|
|
import "google/protobuf/descriptor.proto";
|
|
|
|
option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/retention";
|
|
|
|
// Retention attributes set on fields nested within a message
|
|
message OptionsMessage {
|
|
optional int32 plain_field = 1;
|
|
optional int32 runtime_retention_field = 2 [retention = RETENTION_RUNTIME];
|
|
optional int32 source_retention_field = 3 [retention = RETENTION_SOURCE];
|
|
}
|
|
|
|
extend google.protobuf.FileOptions {
|
|
optional int32 imported_plain_option = 511807920;
|
|
optional int32 imported_runtime_retention_option = 512484074
|
|
[retention = RETENTION_RUNTIME];
|
|
optional int32 imported_source_retention_option = 512645287
|
|
[retention = RETENTION_SOURCE];
|
|
}
|
|
|
|
extend google.protobuf.FileOptions {
|
|
optional OptionsMessage file_option = 504871168;
|
|
} |