mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-01 03:14:16 +00:00
01ab29648e
This change was created by running: git ls-files | xargs sed -i "s|google.golang.org/proto|github.com/golang/protobuf/v2|g" This change is *not* an endorsement of "github.com/golang/protobuf/v2" as the final import path when the v2 API is eventually released as stable. We continue to reserve the right to make breaking changes as we see fit. This change enables us to host the v2 API on a repository that is go-gettable (since go.googlesource.com is not a known host by the "go get" tool; and google.golang.org/proto was just a stub URL that is not currently served). Thus, we can start work on a forked version of the v1 API that explores what it would take to implement v1 in terms of v2 in a backwards compatible way. Change-Id: Ia3ebc41ac4238af62ee140200d3158b53ac9ec48 Reviewed-on: https://go-review.googlesource.com/136736 Reviewed-by: Damien Neil <dneil@google.com>
56 lines
1.8 KiB
Protocol Buffer
56 lines
1.8 KiB
Protocol Buffer
// Copyright 2018 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.protoc.fieldnames;
|
|
|
|
option go_package = "github.com/golang/protobuf/v2/cmd/protoc-gen-go/testdata/fieldnames";
|
|
|
|
// Assorted edge cases in field name conflict resolution.
|
|
//
|
|
// Not all (or possibly any) of these behave in an easily-understood fashion.
|
|
// This exists to demonstrate the current behavior and catch unintended
|
|
// changes in it.
|
|
message Message {
|
|
// Various CamelCase conversions.
|
|
optional string field_one = 1;
|
|
optional string FieldTwo = 2;
|
|
optional string fieldThree = 3;
|
|
optional string field__four = 4;
|
|
|
|
// Field names that conflict with standard methods on the message struct.
|
|
optional string descriptor = 10;
|
|
optional string marshal = 11;
|
|
optional string unmarshal = 12;
|
|
optional string proto_message = 13;
|
|
|
|
// Field names that conflict with each other after CamelCasing.
|
|
optional string CamelCase = 20;
|
|
optional string CamelCase_ = 21;
|
|
optional string camel_case = 22; // conflicts with 20, 21
|
|
optional string CamelCase__ = 23; // conflicts with 21, 21, renamed 22
|
|
|
|
// Field with a getter that conflicts with another field.
|
|
optional string get_name = 30;
|
|
optional string name = 31;
|
|
|
|
// Oneof that conflicts with its first field: The oneof is renamed.
|
|
oneof oneof_conflict_a {
|
|
string OneofConflictA = 40;
|
|
}
|
|
|
|
// Oneof that conflicts with its second field: The field is renamed.
|
|
oneof oneof_conflict_b {
|
|
string oneof_no_conflict = 50;
|
|
string OneofConflictB = 51;
|
|
}
|
|
|
|
// Oneof with a field name that conflicts with a nested message.
|
|
oneof oneof_conflict_c {
|
|
string oneof_message_conflict = 60;
|
|
}
|
|
message OneofMessageConflict {}
|
|
}
|