Skip to content

Commit 04eac41

Browse files
committed
Update docs to mention the proto3 API differences.
Fixes #15.
1 parent 68415e7 commit 04eac41

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ for a protocol buffer variable v:
101101
with distinguished wrapper types for each possible field value.
102102
- Marshal and Unmarshal are functions to encode and decode the wire format.
103103

104+
When the .proto file specifies `syntax="proto3"`, there are some differences:
105+
106+
- Non-repeated fields of non-message type are values instead of pointers.
107+
- Getters are only generated for message and oneof fields.
108+
- Enum types do not get an Enum method.
109+
104110
Consider file test.proto, containing
105111

106112
```proto

proto/lib.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ for a protocol buffer variable v:
7070
with distinguished wrapper types for each possible field value.
7171
- Marshal and Unmarshal are functions to encode and decode the wire format.
7272
73+
When the .proto file specifies `syntax="proto3"`, there are some differences:
74+
75+
- Non-repeated fields of non-message type are values instead of pointers.
76+
- Getters are only generated for message and oneof fields.
77+
- Enum types do not get an Enum method.
78+
7379
The simplest way to describe this is to see an example.
7480
Given file test.proto, containing
7581

0 commit comments

Comments
 (0)