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

Issue 6540045: code review 6540045: vet: fix rangeloop. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by dsymonds
Modified:
11 years, 7 months ago
Reviewers:
CC:
golang-dev, adg, r
Visibility:
Public.

Description

vet: fix rangeloop. In a range loop, the presence of a value implies the presence of a key. However, the presence of a value as an *ast.Ident does not imply that the key is also an *ast.Ident, thus leading to a panic any time the two argument form is used where the key is not an identifier.

Patch Set 1 #

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -2 lines) Patch
M src/cmd/vet/rangeloop.go View 1 2 3 2 chunks +15 lines, -2 lines 0 comments Download

Messages

Total messages: 5
dsymonds
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 7 months ago (2012-09-19 13:04:25 UTC) #1
dsymonds
Also, how the heck do you run this to check against // ERROR lines? "go ...
11 years, 7 months ago (2012-09-19 13:05:54 UTC) #2
adg
LGTM Thanks Dave.
11 years, 7 months ago (2012-09-19 17:04:49 UTC) #3
r
On Wed, Sep 19, 2012 at 6:05 AM, David Symonds <dsymonds@golang.org> wrote: > Also, how ...
11 years, 7 months ago (2012-09-19 18:07:53 UTC) #4
dsymonds
11 years, 7 months ago (2012-09-19 22:12:54 UTC) #5
*** Submitted as http://code.google.com/p/go/source/detail?r=357285dcdff5 ***

vet: fix rangeloop.

In a range loop, the presence of a value implies the presence of a key.
However, the presence of a value as an *ast.Ident does not imply that
the key is also an *ast.Ident, thus leading to a panic any time the
two argument form is used where the key is not an identifier.

R=golang-dev, adg, r
CC=golang-dev
http://codereview.appspot.com/6540045
Sign in to reply to this message.

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