Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1031)

Issue 5437120: code review 5437120: doc: do not slice array literal (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by rsc
Modified:
13 years, 5 months ago
Reviewers:
CC:
r, gri, golang-dev
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r 7551fda5eeef https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 7551fda5eeef https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 7551fda5eeef https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 66d13bc8ae5e https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -7 lines) Patch
M doc/go_tutorial.html View 1 2 3 1 chunk +5 lines, -3 lines 0 comments Download
M doc/go_tutorial.tmpl View 1 2 3 1 chunk +5 lines, -3 lines 0 comments Download
M doc/progs/sum.go View 1 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 4
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 5 months ago (2011-12-02 16:25:21 UTC) #1
gri
LGTM leaving for r
13 years, 5 months ago (2011-12-02 17:18:51 UTC) #2
r
LGTM
13 years, 5 months ago (2011-12-02 17:19:44 UTC) #3
rsc
13 years, 5 months ago (2011-12-02 17:30:39 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=babecff7a7ef ***

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
http://codereview.appspot.com/5437120
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b