| 1 |
// Copyright 2018 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
syntax = "proto2"; |
| 6 |
|
| 7 |
package goproto.protoc.import_public.sub; |
| 8 |
|
| 9 |
import public "cmd/protoc-gen-go/testdata/import_public/sub2/a.proto"; |
| 10 |
|
| 11 |
import "cmd/protoc-gen-go/testdata/import_public/sub/b.proto"; |
| 12 |
|
| 13 |
option go_package = "google.golang.org/protobuf/cmd/protoc-gen-go/testdata/import_public/sub"; |
| 14 |
|
| 15 |
message M { |
| 16 |
// Field using a type in the same Go package, but a different source file. |
| 17 |
optional M2 m2 = 1; |
| 18 |
optional string s = 4 [default = "default"]; |
| 19 |
optional bytes b = 5 [default = "default"]; |
| 20 |
optional double f = 6 [default = nan]; |
| 21 |
|
| 22 |
oneof oneof_field { |
| 23 |
int32 oneof_int32 = 2; |
| 24 |
int64 oneof_int64 = 3; |
| 25 |
} |
| 26 |
|
| 27 |
message Submessage { |
| 28 |
enum Submessage_Subenum { |
| 29 |
M_SUBMESSAGE_ZERO = 0; |
| 30 |
} |
| 31 |
|
| 32 |
oneof submessage_oneof_field { |
| 33 |
int32 submessage_oneof_int32 = 1; |
| 34 |
int64 submessage_oneof_int64 = 2; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
enum Subenum { |
| 39 |
M_ZERO = 0; |
| 40 |
} |
| 41 |
|
| 42 |
extensions 100 to max; |
| 43 |
} |
| 44 |
|
| 45 |
extend M { |
| 46 |
optional string extension_field = 100; |
| 47 |
} |
| 48 |
|
| 49 |
enum E { |
| 50 |
ZERO = 0; |
| 51 |
} |