Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/best-practices/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The following are exceptions to the rule:
opaquely as possible so that you don't create a dependency nexus. Consider
using extensions or [Encode Opaque Data in Strings by Web-safe Encoding
Binary Proto
Serialization](/programming-guides/api#encode-opaque-data-in-strings).
Serialization](/best-practices/api#encode-opaque-data-in-strings).

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

Expand Down
5 changes: 2 additions & 3 deletions content/editions/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ features not explicitly set conform to the behavior defined in the edition
version used for the .proto file.

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

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

**Required label.** The `required` label, available only in proto2, is
unavailable in editions. The underlying functionality is still available (but
[discouraged](/programming-guides/required-considered-harmful))
unavailable in editions. The underlying functionality is still available
by using `features.field_presence=LEGACY_REQUIRED`.
2 changes: 1 addition & 1 deletion content/programming-guides/deserialize-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ and a randomized-length whitespace sequence. The new debugging format looks as
follows:

```none
goo.gle/nodeserialize
goo.gle/debugstr
spii_field: [REDACTED]
normal_field: "value"
```
Expand Down
4 changes: 2 additions & 2 deletions content/programming-guides/proto3.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ automatically generated class:
</tr>
<tr>
<td>string</td>
<td>string</td>
<td>std::string</td>
<td>String</td>
<td>str/unicode<sup>[5]</sup></td>
<td>string</td>
Expand All @@ -628,7 +628,7 @@ automatically generated class:
</tr>
<tr>
<td>bytes</td>
<td>string</td>
<td>std::string</td>
<td>ByteString</td>
<td>str (Python 2), bytes (Python 3)</td>
<td>[]byte</td>
Expand Down
15 changes: 15 additions & 0 deletions content/reference/go/go-generated-opaque.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,21 @@ which provides a reflection-based view of the message.

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

When multiple goroutines concurrently access the same message, the following
rules apply:

* Accessing (reading) fields concurrently is safe, with one exception:
* Accessing a [lazy field](https://github.com/protocolbuffers/protobuf/blob/cacb096002994000f8ccc6d9b8e1b5b0783ee561/src/google/protobuf/descriptor.proto#L609)
for the first time is a modification.
* Modifying different fields in the same message is safe.
* Modifying a field concurrently is not safe.
* Modifying a message in any way concurrently with functions of the
[`proto` package](https://pkg.go.dev/google.golang.org/protobuf/proto?tab=doc),
such as
[`proto.Marshal`](https://pkg.go.dev/google.golang.org/protobuf/proto#Marshal)
or [`proto.Size`](https://pkg.go.dev/google.golang.org/protobuf/proto#Size)
is not safe.

### Nested Types

A message can be declared inside another message. For example:
Expand Down
15 changes: 15 additions & 0 deletions content/reference/go/go-generated.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,21 @@ which provides a reflection-based view of the message.

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

When multiple goroutines concurrently access the same message, the following
rules apply:

* Accessing (reading) fields concurrently is safe, with one exception:
* Accessing a [lazy field](https://github.com/protocolbuffers/protobuf/blob/cacb096002994000f8ccc6d9b8e1b5b0783ee561/src/google/protobuf/descriptor.proto#L609)
for the first time is a modification.
* Modifying different fields in the same message is safe.
* Modifying a field concurrently is not safe.
* Modifying a message in any way concurrently with functions of the
[`proto` package](https://pkg.go.dev/google.golang.org/protobuf/proto?tab=doc),
such as
[`proto.Marshal`](https://pkg.go.dev/google.golang.org/protobuf/proto#Marshal)
or [`proto.Size`](https://pkg.go.dev/google.golang.org/protobuf/proto#Size)
is not safe.

### Nested Types

A message can be declared inside another message. For example:
Expand Down