Bläddra i källkod

Update docs to mention the proto3 API differences.

Fixes #15.
David Symonds 10 år sedan
förälder
incheckning
04eac41517
2 ändrade filer med 12 tillägg och 0 borttagningar
  1. 6 0
      README.md
  2. 6 0
      proto/lib.go

+ 6 - 0
README.md

@@ -101,6 +101,12 @@ for a protocol buffer variable v:
 	with distinguished wrapper types for each possible field value.
   - Marshal and Unmarshal are functions to encode and decode the wire format.
 
+When the .proto file specifies `syntax="proto3"`, there are some differences:
+
+  - Non-repeated fields of non-message type are values instead of pointers.
+  - Getters are only generated for message and oneof fields.
+  - Enum types do not get an Enum method.
+
 Consider file test.proto, containing
 
 ```proto

+ 6 - 0
proto/lib.go

@@ -70,6 +70,12 @@ for a protocol buffer variable v:
 	with distinguished wrapper types for each possible field value.
   - Marshal and Unmarshal are functions to encode and decode the wire format.
 
+When the .proto file specifies `syntax="proto3"`, there are some differences:
+
+  - Non-repeated fields of non-message type are values instead of pointers.
+  - Getters are only generated for message and oneof fields.
+  - Enum types do not get an Enum method.
+
 The simplest way to describe this is to see an example.
 Given file test.proto, containing