Skip to content

Commit 562f010

Browse files
authored
Merge pull request #231 from Logofile/sync
Documentation change
2 parents 7cd2d28 + 45a76d4 commit 562f010

File tree

6 files changed

+36
-7
lines changed

6 files changed

+36
-7
lines changed

content/best-practices/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ The following are exceptions to the rule:
124124
opaquely as possible so that you don't create a dependency nexus. Consider
125125
using extensions or [Encode Opaque Data in Strings by Web-safe Encoding
126126
Binary Proto
127-
Serialization](/programming-guides/api#encode-opaque-data-in-strings).
127+
Serialization](/best-practices/api#encode-opaque-data-in-strings).
128128

129129
## For Mutations, Support Partial Updates or Append-Only Updates, Not Full Replaces {#support-partial-updates}
130130

content/editions/overview.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ features not explicitly set conform to the behavior defined in the edition
237237
version used for the .proto file.
238238

239239
The following code sample shows some features being set at the file, field, and
240-
enum level. The settings are in the highlighted lines:
240+
enum level.
241241

242242
```proto {highlight="lines:3,7,16"}
243243
edition = "2023";
@@ -333,6 +333,5 @@ special wire-format that groups used is still available by using `DELIMITED`
333333
message encoding.
334334

335335
**Required label.** The `required` label, available only in proto2, is
336-
unavailable in editions. The underlying functionality is still available (but
337-
[discouraged](/programming-guides/required-considered-harmful))
336+
unavailable in editions. The underlying functionality is still available
338337
by using `features.field_presence=LEGACY_REQUIRED`.

content/programming-guides/deserialize-debug.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ and a randomized-length whitespace sequence. The new debugging format looks as
2424
follows:
2525

2626
```none
27-
goo.gle/nodeserialize
27+
goo.gle/debugstr
2828
spii_field: [REDACTED]
2929
normal_field: "value"
3030
```

content/programming-guides/proto3.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ automatically generated class:
616616
</tr>
617617
<tr>
618618
<td>string</td>
619-
<td>string</td>
619+
<td>std::string</td>
620620
<td>String</td>
621621
<td>str/unicode<sup>[5]</sup></td>
622622
<td>string</td>
@@ -628,7 +628,7 @@ automatically generated class:
628628
</tr>
629629
<tr>
630630
<td>bytes</td>
631-
<td>string</td>
631+
<td>std::string</td>
632632
<td>ByteString</td>
633633
<td>str (Python 2), bytes (Python 3)</td>
634634
<td>[]byte</td>

content/reference/go/go-generated-opaque.md

+15
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,21 @@ which provides a reflection-based view of the message.
210210

211211
The `optimize_for` option does not affect the output of the Go code generator.
212212

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
222+
[`proto` package](https://pkg.go.dev/google.golang.org/protobuf/proto?tab=doc),
223+
such as
224+
[`proto.Marshal`](https://pkg.go.dev/google.golang.org/protobuf/proto#Marshal)
225+
or [`proto.Size`](https://pkg.go.dev/google.golang.org/protobuf/proto#Size)
226+
is not safe.
227+
213228
### Nested Types
214229

215230
A message can be declared inside another message. For example:

content/reference/go/go-generated.md

+15
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,21 @@ which provides a reflection-based view of the message.
209209

210210
The `optimize_for` option does not affect the output of the Go code generator.
211211

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
221+
[`proto` package](https://pkg.go.dev/google.golang.org/protobuf/proto?tab=doc),
222+
such as
223+
[`proto.Marshal`](https://pkg.go.dev/google.golang.org/protobuf/proto#Marshal)
224+
or [`proto.Size`](https://pkg.go.dev/google.golang.org/protobuf/proto#Size)
225+
is not safe.
226+
212227
### Nested Types
213228

214229
A message can be declared inside another message. For example:

0 commit comments

Comments
 (0)