Commit 369d1083 authored by Robert Griesemer's avatar Robert Griesemer

spec: for non-constant map keys, add reference to evaluation order section

The section on map literals mentions constant map keys but doesn't say
what happens for equal non-constant map keys - that is covered in the
section on evaluation order. Added respective link for clarity.

Fixes #19689.

Change-Id: If9a5368ba02e8250d4bb0a1d60d0de26a1f37bbb
Reviewed-on: https://go-review.googlesource.com/38598Reviewed-by: 's avatarRob Pike <r@golang.org>
Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
parent e00e57d6
<!--{
"Title": "The Go Programming Language Specification",
"Subtitle": "Version of February 12, 2017",
"Subtitle": "Version of March 24, 2017",
"Path": "/ref/spec"
}-->
......@@ -2295,7 +2295,8 @@ The key is interpreted as a field name for struct literals,
an index for array and slice literals, and a key for map literals.
For map literals, all elements must have a key. It is an error
to specify multiple elements with the same field name or
constant key value.
constant key value. For non-constant map keys, see the section on
<a href="#Order_of_evaluation">evaluation order</a>.
</p>
<p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment