1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:34:40 -07:00
go/doc
Robert Griesemer 7727dee445 spec: extend type omission rules for composite literal element values
to map element keys

Composite literals containing element values that are themselves composite
literals may leave away the element's literal types if they are identical
to the enclosing composite literal's element type.

(http://golang.org/ref/spec#Composite_literals)

When we made this change, we forgot to apply the analogous rule to map
literal keys. This change generalizes that rule. Added more examples,
including one showing the recursive application of the elision rules.

This is a fully backward-compatible language change. It was discussed
some time back.

Fixes #8589.

To be submitted once all compilers accept the extension.

Change-Id: I4d45b64b5970f0d5501572945d5a097e64a9458b
Reviewed-on: https://go-review.googlesource.com/2591
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2015-03-20 23:06:28 +00:00
..
articles all: use golang.org/x/... import paths 2014-11-10 09:15:57 +11:00
codewalk doc: fix typo in sharemem codewalk 2014-05-21 14:34:20 -07:00
devel doc: document Go 1.4.2 2015-02-18 03:29:47 +00:00
gopher doc/gopher: add jpgs of the 5th anniversary image 2014-11-11 23:46:20 +11:00
play doc/play: revise peano.go comment again. 2014-12-12 01:40:04 +00:00
progs doc/progs: don't try building cgo tests if CGO_ENABLED=0 2013-10-11 08:55:13 -07:00
asm.html doc/asm: document that assembly function must use short name 2015-02-15 00:07:11 +00:00
cmd.html all: use golang.org/x/... import paths 2014-11-10 09:15:57 +11:00
code.html doc: Added link to 'go help gopath' 2015-01-05 21:24:39 +00:00
contrib.html [release-branch.go1.4] doc: scrub references to code.google.com 2014-12-12 14:00:48 +11:00
contribute.html doc/contribute.html rewrite "Set up auth... code review". 2015-03-02 02:11:58 +00:00
debugging_with_gdb.html build: adjustments for move from src/pkg to src 2014-09-08 00:06:45 -04:00
docs.html doc: drop scheme from links that are known to support HTTPS 2014-07-25 10:28:39 +10:00
effective_go.html doc/effective_go.html: add missing newline 2015-03-12 16:31:23 +00:00
gccgo_contribute.html all: don't refer to code.google.com/p/go{,-wiki}/ 2015-02-06 14:41:47 +00:00
gccgo_install.html gccgo_install.html: the 4.9 release series supports Go 1.2 2014-10-22 20:41:13 -07:00
go1.1.html doc: drop scheme from links that are known to support HTTPS 2014-07-25 10:28:39 +10:00
go1.2.html doc: drop scheme from links that are known to support HTTPS 2014-07-25 10:28:39 +10:00
go1.3.html [release-branch.go1.4] doc: scrub references to code.google.com 2014-12-12 14:00:48 +11:00
go1.4.html doc: tweak Go 1.4 release notes 2014-12-11 17:38:49 +11:00
go1.5.txt doc/go1.5: correct archive/zip change 2015-03-15 21:24:35 +00:00
go1.html doc: link directly to https://golang.org/dl/ 2014-09-12 09:15:58 +10:00
go1compat.html all: use golang.org/x/... import paths 2014-11-10 09:15:57 +11:00
go_faq.html doc: update links in FAQ 2014-12-30 05:52:03 +00:00
go_mem.html doc/go_mem.html: correct the channel example 2015-03-16 21:43:31 +00:00
go_spec.html spec: extend type omission rules for composite literal element values 2015-03-20 23:06:28 +00:00
go-logo-black.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go-logo-blue.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
go-logo-white.png doc: pngcrush and remove old, unused images 2012-03-08 14:18:28 +11:00
help.html [release-branch.go1.4] doc: scrub references to code.google.com 2014-12-12 14:00:48 +11:00
ie.css golang.org redesign 2010-09-16 14:01:02 +10:00
install-source.html doc/install-source.html: fix cd command, already in go dir. 2015-02-25 21:34:01 +00:00
install.html runtime, syscall: use SYSCALL instruction on FreeBSD. 2015-01-18 23:51:50 +00:00
root.html doc: drop scheme from links that are known to support HTTPS 2014-07-25 10:28:39 +10:00
share.png godoc: change link styles, add 'pop out' button 2012-03-13 11:00:11 +11:00
tos.html doc: drop scheme from links that are known to support HTTPS 2014-07-25 10:28:39 +10:00