]> Cypherpunks repositories - gostls13.git/commit
doc: do not slice array literal
authorRuss Cox <rsc@golang.org>
Fri, 2 Dec 2011 17:30:37 +0000 (12:30 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 2 Dec 2011 17:30:37 +0000 (12:30 -0500)
commitda5a251dde539c91c87caab4abe3d346f88e82fc
treee7f498aaa132850455865878c8e35e93ab7e6574
parent4dfe976d974669e1234fbcd4f95341be41c1e575
doc: do not slice array literal

The special case in the spec is that you can take the
address of a composite literal using the & operator.

A composite literal is not, however, generally addressable,
and the slice operator requires an addressable argument,
so [3]int{1,2,3}[:] is invalid.  This tutorial code and one bug
report are the only places in the tree where it appears.

R=r, gri
CC=golang-dev
https://golang.org/cl/5437120
doc/go_tutorial.html
doc/go_tutorial.tmpl
doc/progs/sum.go