]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1] go/ast: ast.Print must not crash with unexported fields
authorRobert Griesemer <gri@golang.org>
Fri, 21 Sep 2012 19:54:24 +0000 (05:54 +1000)
committerRobert Griesemer <gri@golang.org>
Fri, 21 Sep 2012 19:54:24 +0000 (05:54 +1000)
commitdda61d68c848e16feab2d2c910768df8503888e0
tree9b141def5e179d573ba5923107aa187acd6343d1
parent6425aa28f22fc8c3deb806969988d68e0584f1cb
[release-branch.go1] go/ast: ast.Print must not crash with unexported fields

««« backport 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 #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
https://golang.org/cl/6454089

»»»
src/pkg/go/ast/print.go
src/pkg/go/ast/print_test.go