diff options
| author | Robert Griesemer <gri@google.com> | 2026-03-16 15:30:40 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-16 19:07:40 -0700 |
| commit | c697e0fc482de62da72d4470ac082bf5e5720642 (patch) | |
| tree | 50d992e49090f4ab5f5a2ecfd4c877e861c673ed | |
| parent | f3966c1ada0a0ddaea873f979ee9165649eb11b7 (diff) | |
| download | go-c697e0fc482de62da72d4470ac082bf5e5720642.tar.xz | |
spec: fix prose in rule for keys of struct composite literals
Use "promoted" rather than "embedded" because the selector
provides access to a promoted field.
For #9859.
Change-Id: If62c5260ab7bdfef3d6ea4ff770543ad668ac9b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/755782
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
| -rw-r--r-- | doc/go_spec.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html index ab2d89a7d9..e378e0b0dc 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ <!--{ "Title": "The Go Programming Language Specification", - "Subtitle": "Language version go1.27 (March 5, 2026)", + "Subtitle": "Language version go1.27 (March 16, 2026)", "Path": "/ref/spec" }--> @@ -3211,13 +3211,13 @@ For struct literals with keys the following rules apply: <li>Every element must have a key. </li> <li>Each key must be a valid field <a href="#Selectors">selector</a> - [<a href="#Go_1.27">Go 1.27</a>] for a (possibly embedded) field + [<a href="#Go_1.27">Go 1.27</a>] for a (possibly promoted) field of the struct; the key selects that field. </li> <li>The types of the embedded fields (if any) <a href="#Selectors">traversed</a> to reach a selected field must not be pointer types. </li> - <li>A key must not denote a field inside an embedded struct if + <li>A key must not denote a promoted field inside an embedded struct if that struct is also specified by another key. </li> <li>The element list does not need to have an element for each struct field. |
