You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fixes links to remove redirects
* Removes some content that applies only internally at Google
* Updates the code samples for the Deserializing Debug Proto Representations topic
* Corrects C++ data types in the Scalar Value Types table
* Adds information about what happens when multiple goroutines concurrently access the same message
PiperOrigin-RevId: 730923238
Change-Id: I9555d3c880fed96dadb280cbe613f2f9cba4d298
Copy file name to clipboardExpand all lines: content/reference/go/go-generated-opaque.md
+15
Original file line number
Diff line number
Diff line change
@@ -210,6 +210,21 @@ which provides a reflection-based view of the message.
210
210
211
211
The `optimize_for` option does not affect the output of the Go code generator.
212
212
213
+
When multiple goroutines concurrently access the same message, the following
214
+
rules apply:
215
+
216
+
* Accessing (reading) fields concurrently is safe, with one exception:
217
+
* Accessing a [lazy field](https://github.com/protocolbuffers/protobuf/blob/cacb096002994000f8ccc6d9b8e1b5b0783ee561/src/google/protobuf/descriptor.proto#L609)
218
+
for the first time is a modification.
219
+
* Modifying different fields in the same message is safe.
220
+
* Modifying a field concurrently is not safe.
221
+
* Modifying a message in any way concurrently with functions of the
Copy file name to clipboardExpand all lines: content/reference/go/go-generated.md
+15
Original file line number
Diff line number
Diff line change
@@ -209,6 +209,21 @@ which provides a reflection-based view of the message.
209
209
210
210
The `optimize_for` option does not affect the output of the Go code generator.
211
211
212
+
When multiple goroutines concurrently access the same message, the following
213
+
rules apply:
214
+
215
+
* Accessing (reading) fields concurrently is safe, with one exception:
216
+
* Accessing a [lazy field](https://github.com/protocolbuffers/protobuf/blob/cacb096002994000f8ccc6d9b8e1b5b0783ee561/src/google/protobuf/descriptor.proto#L609)
217
+
for the first time is a modification.
218
+
* Modifying different fields in the same message is safe.
219
+
* Modifying a field concurrently is not safe.
220
+
* Modifying a message in any way concurrently with functions of the
0 commit comments