Skip to content

Commit a6a71f7

Browse files
committed
Simplify syntax in example code
Use a semicolon instead of an empty options list. This is consistent with the style guide and examples and in the protobuf documentation: - https://developers.google.com/protocol-buffers/docs/style#services - https://developers.google.com/protocol-buffers/docs/proto3#services - https://developers.google.com/protocol-buffers/docs/reference/proto3-spec#service_definition
1 parent d076f4d commit a6a71f7

24 files changed

+79
-79
lines changed

content/blog/bazel-rules-protobuf.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ responds with a single `HelloReply`:
608608

609609
```c
610610
service Greeter {
611-
rpc SayHello (HelloRequest) returns (HelloReply) {}
611+
rpc SayHello (HelloRequest) returns (HelloReply);
612612
}
613613

614614
message HelloRequest {

content/docs/guides/_index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protocol buffer messages:
6565
// The greeter service definition.
6666
service Greeter {
6767
// Sends a greeting
68-
rpc SayHello (HelloRequest) returns (HelloReply) {}
68+
rpc SayHello (HelloRequest) returns (HelloReply);
6969
}
7070
7171
// The request message containing the user's name.

content/docs/quickstart/android.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ server, and that this method is defined like this:
7171
// The greeting service definition.
7272
service Greeter {
7373
// Sends a greeting
74-
rpc SayHello (HelloRequest) returns (HelloReply) {}
74+
rpc SayHello (HelloRequest) returns (HelloReply);
7575
}
7676
7777
// The request message containing the user's name.
@@ -92,9 +92,9 @@ method, with the same request and response types:
9292
// The greeting service definition.
9393
service Greeter {
9494
// Sends a greeting
95-
rpc SayHello (HelloRequest) returns (HelloReply) {}
95+
rpc SayHello (HelloRequest) returns (HelloReply);
9696
// Sends another greeting
97-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
97+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
9898
}
9999

100100
// The request message containing the user's name.

content/docs/quickstart/cpp.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ server, and that this method is defined like this:
183183
// The greeting service definition.
184184
service Greeter {
185185
// Sends a greeting
186-
rpc SayHello (HelloRequest) returns (HelloReply) {}
186+
rpc SayHello (HelloRequest) returns (HelloReply);
187187
}
188188
189189
// The request message containing the user's name.
@@ -204,9 +204,9 @@ same request and response types:
204204
// The greeting service definition.
205205
service Greeter {
206206
// Sends a greeting
207-
rpc SayHello (HelloRequest) returns (HelloReply) {}
207+
rpc SayHello (HelloRequest) returns (HelloReply);
208208
// Sends another greeting
209-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
209+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
210210
}
211211

212212
// The request message containing the user's name.

content/docs/quickstart/csharp.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ server, and that this method is defined like this:
9393
// The greeting service definition.
9494
service Greeter {
9595
// Sends a greeting
96-
rpc SayHello (HelloRequest) returns (HelloReply) {}
96+
rpc SayHello (HelloRequest) returns (HelloReply);
9797
}
9898
9999
// The request message containing the user's name.
@@ -115,9 +115,9 @@ method, with the same request and response types:
115115
// The greeting service definition.
116116
service Greeter {
117117
// Sends a greeting
118-
rpc SayHello (HelloRequest) returns (HelloReply) {}
118+
rpc SayHello (HelloRequest) returns (HelloReply);
119119
// Sends another greeting
120-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
120+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
121121
}
122122
123123
// The request message containing the user's name.

content/docs/quickstart/dart.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ server, and that this method is defined like this:
102102
// The greeting service definition.
103103
service Greeter {
104104
// Sends a greeting
105-
rpc SayHello (HelloRequest) returns (HelloReply) {}
105+
rpc SayHello (HelloRequest) returns (HelloReply);
106106
}
107107

108108
// The request message containing the user's name.
@@ -123,9 +123,9 @@ same request and response types:
123123
// The greeting service definition.
124124
service Greeter {
125125
// Sends a greeting
126-
rpc SayHello (HelloRequest) returns (HelloReply) {}
126+
rpc SayHello (HelloRequest) returns (HelloReply);
127127
// Sends another greeting
128-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
128+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
129129
}
130130
131131
// The request message containing the user's name.

content/docs/quickstart/go.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ is defined like this:
100100
// The greeting service definition.
101101
service Greeter {
102102
// Sends a greeting
103-
rpc SayHello (HelloRequest) returns (HelloReply) {}
103+
rpc SayHello (HelloRequest) returns (HelloReply);
104104
}
105105
106106
// The request message containing the user's name.
@@ -125,9 +125,9 @@ method, with the same request and response types:
125125
// The greeting service definition.
126126
service Greeter {
127127
// Sends a greeting
128-
rpc SayHello (HelloRequest) returns (HelloReply) {}
128+
rpc SayHello (HelloRequest) returns (HelloReply);
129129
// Sends another greeting
130-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
130+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
131131
}
132132
133133
// The request message containing the user's name.

content/docs/quickstart/java.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ server, and that this method is defined like this:
6262
// The greeting service definition.
6363
service Greeter {
6464
// Sends a greeting
65-
rpc SayHello (HelloRequest) returns (HelloReply) {}
65+
rpc SayHello (HelloRequest) returns (HelloReply);
6666
}
6767
6868
// The request message containing the user's name.
@@ -83,9 +83,9 @@ method, with the same request and response types:
8383
// The greeting service definition.
8484
service Greeter {
8585
// Sends a greeting
86-
rpc SayHello (HelloRequest) returns (HelloReply) {}
86+
rpc SayHello (HelloRequest) returns (HelloReply);
8787
// Sends another greeting
88-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
88+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
8989
}
9090

9191
// The request message containing the user's name.

content/docs/quickstart/node.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ method that takes a `HelloRequest` parameter from the client and returns a
5858
// The greeting service definition.
5959
service Greeter {
6060
// Sends a greeting
61-
rpc SayHello (HelloRequest) returns (HelloReply) {}
61+
rpc SayHello (HelloRequest) returns (HelloReply);
6262
}
6363
6464
// The request message containing the user's name.
@@ -80,9 +80,9 @@ method, with the same request and response types:
8080
// The greeting service definition.
8181
service Greeter {
8282
// Sends a greeting
83-
rpc SayHello (HelloRequest) returns (HelloReply) {}
83+
rpc SayHello (HelloRequest) returns (HelloReply);
8484
// Sends another greeting
85-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
85+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
8686
}
8787

8888
// The request message containing the user's name.

content/docs/quickstart/objective-c.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ RPC method that takes a `HelloRequest` parameter from the client and returns a
129129
// The greeting service definition.
130130
service Greeter {
131131
// Sends a greeting
132-
rpc SayHello (HelloRequest) returns (HelloReply) {}
132+
rpc SayHello (HelloRequest) returns (HelloReply);
133133
}
134134
135135
// The request message containing the user's name.
@@ -151,9 +151,9 @@ method, with the same request and response types:
151151
// The greeting service definition.
152152
service Greeter {
153153
// Sends a greeting
154-
rpc SayHello (HelloRequest) returns (HelloReply) {}
154+
rpc SayHello (HelloRequest) returns (HelloReply);
155155
// Sends another greeting
156-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
156+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
157157
}
158158
159159
// The request message containing the user's name.

content/docs/quickstart/php.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ the server, and that this method is defined like this:
311311
// The greeting service definition.
312312
service Greeter {
313313
// Sends a greeting
314-
rpc SayHello (HelloRequest) returns (HelloReply) {}
314+
rpc SayHello (HelloRequest) returns (HelloReply);
315315
}
316316
317317
// The request message containing the user's name.
@@ -333,9 +333,9 @@ method, with the same request and response types:
333333
// The greeting service definition.
334334
service Greeter {
335335
// Sends a greeting
336-
rpc SayHello (HelloRequest) returns (HelloReply) {}
336+
rpc SayHello (HelloRequest) returns (HelloReply);
337337
// Sends another greeting
338-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
338+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
339339
}
340340

341341
// The request message containing the user's name.

content/docs/quickstart/python.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ method that takes a `HelloRequest` parameter from the client and returns a
115115
// The greeting service definition.
116116
service Greeter {
117117
// Sends a greeting
118-
rpc SayHello (HelloRequest) returns (HelloReply) {}
118+
rpc SayHello (HelloRequest) returns (HelloReply);
119119
}
120120
121121
// The request message containing the user's name.
@@ -137,9 +137,9 @@ method, with the same request and response types:
137137
// The greeting service definition.
138138
service Greeter {
139139
// Sends a greeting
140-
rpc SayHello (HelloRequest) returns (HelloReply) {}
140+
rpc SayHello (HelloRequest) returns (HelloReply);
141141
// Sends another greeting
142-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
142+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
143143
}
144144
145145
// The request message containing the user's name.

content/docs/quickstart/ruby.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ method that takes a `HelloRequest` parameter from the client and returns a
8080
// The greeting service definition.
8181
service Greeter {
8282
// Sends a greeting
83-
rpc SayHello (HelloRequest) returns (HelloReply) {}
83+
rpc SayHello (HelloRequest) returns (HelloReply);
8484
}
8585
8686
// The request message containing the user's name.
@@ -102,9 +102,9 @@ method, with the same request and response types:
102102
// The greeting service definition.
103103
service Greeter {
104104
// Sends a greeting
105-
rpc SayHello (HelloRequest) returns (HelloReply) {}
105+
rpc SayHello (HelloRequest) returns (HelloReply);
106106
// Sends another greeting
107-
rpc SayHelloAgain (HelloRequest) returns (HelloReply) {}
107+
rpc SayHelloAgain (HelloRequest) returns (HelloReply);
108108
}
109109

110110
// The request message containing the user's name.

content/docs/tutorials/basic/android.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Then we define `rpc` methods inside our service definition, specifying their req
6767

6868
```proto
6969
// Obtains the feature at a given position.
70-
rpc GetFeature(Point) returns (Feature) {}
70+
rpc GetFeature(Point) returns (Feature);
7171
```
7272

7373
- A *server-side streaming RPC* where the client sends a request to the server
@@ -81,7 +81,7 @@ Then we define `rpc` methods inside our service definition, specifying their req
8181
// streamed rather than returned at once (e.g. in a response message with a
8282
// repeated field), as the rectangle may cover a large area and contain a
8383
// huge number of features.
84-
rpc ListFeatures(Rectangle) returns (stream Feature) {}
84+
rpc ListFeatures(Rectangle) returns (stream Feature);
8585
```
8686

8787
- A *client-side streaming RPC* where the client writes a sequence of messages
@@ -93,7 +93,7 @@ Then we define `rpc` methods inside our service definition, specifying their req
9393
```proto
9494
// Accepts a stream of Points on a route being traversed, returning a
9595
// RouteSummary when traversal is completed.
96-
rpc RecordRoute(stream Point) returns (RouteSummary) {}
96+
rpc RecordRoute(stream Point) returns (RouteSummary);
9797
```
9898

9999
- A *bidirectional streaming RPC* where both sides send a sequence of messages
@@ -108,7 +108,7 @@ Then we define `rpc` methods inside our service definition, specifying their req
108108
```proto
109109
// Accepts a stream of RouteNotes sent while a route is being traversed,
110110
// while receiving other RouteNotes (e.g. from other users).
111-
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
111+
rpc RouteChat(stream RouteNote) returns (stream RouteNote);
112112
```
113113

114114
Our `.proto` file also contains protocol buffer message type definitions for all

content/docs/tutorials/basic/cpp.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ all of which are used in the `RouteGuide` service:
8585

8686
```protobuf
8787
// Obtains the feature at a given position.
88-
rpc GetFeature(Point) returns (Feature) {}
88+
rpc GetFeature(Point) returns (Feature);
8989
```
9090

9191
- A *server-side streaming RPC* where the client sends a request to the server
@@ -99,7 +99,7 @@ all of which are used in the `RouteGuide` service:
9999
// streamed rather than returned at once (e.g. in a response message with a
100100
// repeated field), as the rectangle may cover a large area and contain a
101101
// huge number of features.
102-
rpc ListFeatures(Rectangle) returns (stream Feature) {}
102+
rpc ListFeatures(Rectangle) returns (stream Feature);
103103
```
104104

105105
- A *client-side streaming RPC* where the client writes a sequence of messages
@@ -111,7 +111,7 @@ all of which are used in the `RouteGuide` service:
111111
```protobuf
112112
// Accepts a stream of Points on a route being traversed, returning a
113113
// RouteSummary when traversal is completed.
114-
rpc RecordRoute(stream Point) returns (RouteSummary) {}
114+
rpc RecordRoute(stream Point) returns (RouteSummary);
115115
```
116116

117117
- A *bidirectional streaming RPC* where both sides send a sequence of messages
@@ -126,7 +126,7 @@ all of which are used in the `RouteGuide` service:
126126
```protobuf
127127
// Accepts a stream of RouteNotes sent while a route is being traversed,
128128
// while receiving other RouteNotes (e.g. from other users).
129-
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
129+
rpc RouteChat(stream RouteNote) returns (stream RouteNote);
130130
```
131131

132132
Our `.proto` file also contains protocol buffer message type definitions for all

content/docs/tutorials/basic/csharp.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ all of which are used in the `RouteGuide` service:
7979

8080
```protobuf
8181
// Obtains the feature at a given position.
82-
rpc GetFeature(Point) returns (Feature) {}
82+
rpc GetFeature(Point) returns (Feature);
8383
```
8484

8585
- A *server-side streaming RPC* where the client sends a request to the server
@@ -93,7 +93,7 @@ all of which are used in the `RouteGuide` service:
9393
// streamed rather than returned at once (e.g. in a response message with a
9494
// repeated field), as the rectangle may cover a large area and contain a
9595
// huge number of features.
96-
rpc ListFeatures(Rectangle) returns (stream Feature) {}
96+
rpc ListFeatures(Rectangle) returns (stream Feature);
9797
```
9898

9999
- A *client-side streaming RPC* where the client writes a sequence of messages
@@ -105,7 +105,7 @@ all of which are used in the `RouteGuide` service:
105105
```protobuf
106106
// Accepts a stream of Points on a route being traversed, returning a
107107
// RouteSummary when traversal is completed.
108-
rpc RecordRoute(stream Point) returns (RouteSummary) {}
108+
rpc RecordRoute(stream Point) returns (RouteSummary);
109109
```
110110

111111
- A *bidirectional streaming RPC* where both sides send a sequence of messages
@@ -120,7 +120,7 @@ all of which are used in the `RouteGuide` service:
120120
```protobuf
121121
// Accepts a stream of RouteNotes sent while a route is being traversed,
122122
// while receiving other RouteNotes (e.g. from other users).
123-
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
123+
rpc RouteChat(stream RouteNote) returns (stream RouteNote);
124124
```
125125

126126
Our `.proto` file also contains protocol buffer message type definitions for all

content/docs/tutorials/basic/dart.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ all of which are used in the `RouteGuide` service:
7979

8080
```proto
8181
// Obtains the feature at a given position.
82-
rpc GetFeature(Point) returns (Feature) {}
82+
rpc GetFeature(Point) returns (Feature);
8383
```
8484

8585
- A *server-side streaming RPC* where the client sends a request to the server
@@ -93,7 +93,7 @@ all of which are used in the `RouteGuide` service:
9393
// streamed rather than returned at once (e.g. in a response message with a
9494
// repeated field), as the rectangle may cover a large area and contain a
9595
// huge number of features.
96-
rpc ListFeatures(Rectangle) returns (stream Feature) {}
96+
rpc ListFeatures(Rectangle) returns (stream Feature);
9797
```
9898

9999
- A *client-side streaming RPC* where the client writes a sequence of messages
@@ -105,7 +105,7 @@ all of which are used in the `RouteGuide` service:
105105
```proto
106106
// Accepts a stream of Points on a route being traversed, returning a
107107
// RouteSummary when traversal is completed.
108-
rpc RecordRoute(stream Point) returns (RouteSummary) {}
108+
rpc RecordRoute(stream Point) returns (RouteSummary);
109109
```
110110

111111
- A *bidirectional streaming RPC* where both sides send a sequence of messages
@@ -120,7 +120,7 @@ all of which are used in the `RouteGuide` service:
120120
```proto
121121
// Accepts a stream of RouteNotes sent while a route is being traversed,
122122
// while receiving other RouteNotes (e.g. from other users).
123-
rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
123+
rpc RouteChat(stream RouteNote) returns (stream RouteNote);
124124
```
125125

126126
Our `.proto` file also contains protocol buffer message type definitions for all

0 commit comments

Comments
 (0)