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

Issue 6454089: code review 6454089: go/ast: ast.Print must not crash with unexported fields (Closed)

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

Description

go/ast: ast.Print must not crash with unexported fields Don't print unexported struct fields; their values are not accessible via reflection. Fixes issue 3898. Also: - added support for arrays - print empty maps, arrays, slices, structs on one line for a denser output - added respective test cases

Patch Set 1 #

Patch Set 2 : diff -r d441ebed2b51 https://code.google.com/p/go #

Patch Set 3 : diff -r d441ebed2b51 https://code.google.com/p/go #

Total comments: 1

Patch Set 4 : diff -r 853668b30673 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -22 lines) Patch
M src/pkg/go/ast/print.go View 1 3 chunks +51 lines, -22 lines 0 comments Download
M src/pkg/go/ast/print_test.go View 1 2 3 chunks +21 lines, -0 lines 0 comments Download

Messages

Total messages: 3
gri
Hello r@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 8 months ago (2012-08-02 22:40:40 UTC) #1
r
LGTM http://codereview.appspot.com/6454089/diff/4001/src/pkg/go/ast/print.go File src/pkg/go/ast/print.go (right): http://codereview.appspot.com/6454089/diff/4001/src/pkg/go/ast/print.go#newcode216 src/pkg/go/ast/print.go:216: if name := t.Field(i).Name; IsExported(name) { i'd use ...
11 years, 8 months ago (2012-08-02 23:47:38 UTC) #2
gri
11 years, 8 months ago (2012-08-03 00:06:00 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=d134e30c4d29 ***

go/ast: ast.Print must not crash with unexported fields

Don't print unexported struct fields; their values are
not accessible via reflection.

Fixes issue 3898.

Also:
- added support for arrays
- print empty maps, arrays, slices, structs on one line
  for a denser output
- added respective test cases

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

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