Robert Hencke
a51b8cf870
gofmt: explain why lower bounds aren't automatically simplified
...
Full credit goes to gri and rsc for their explanations.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14229043
2013-10-03 10:55:17 -07:00
Robert Griesemer
0cbca268d8
gofmt: simplify slices of the form s[a : len(s)] to s[a:]
...
Fixes #4314 .
R=r, rsc
CC=golang-dev
https://golang.org/cl/6822059
2012-10-31 11:48:55 -07:00
Olivier Duperray
c40314821b
cmd/gofmt: fix simplify.go by running gofmt on cmd/gofmt
...
R=golang-dev
CC=golang-dev
https://golang.org/cl/5539061
2012-01-13 18:05:47 -08:00
Russ Cox
0dab624b70
gofmt: handle &T in composite literal simplify
...
R=gri
CC=golang-dev
https://golang.org/cl/5448086
2011-12-02 14:14:04 -05:00
Robert Griesemer
90564a9256
go/printer: changed max. number of newlines from 3 to 2
...
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src
runs all tests
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Russ Cox
07abf1c732
fix tree for reflect rename
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4435067
2011-04-25 13:39:36 -04:00
Robert Griesemer
e1d6b3c98d
go/ast: fix ast.Walk
...
- change Walk signature to use an ast.Node instead of interface{}
- add Pos functions to a couple of ast types to make them proper nodes
- explicit nil checks where a node can be nil; incorrect ASTs cause Walk to crash
For now ast.Walk is exercised extensively as part of godoc's indexer;
so we have some confidence in its correctness. But this needs a test,
eventually.
Fixes #1326 .
R=rsc, r
CC=golang-dev
https://golang.org/cl/3481043
2010-12-09 10:22:01 -08:00
Robert Griesemer
e2da3b6498
gofmt: simplify "x, _ = range y" to "x = range y"
...
(inspired by CL 3529041 by hitchmanr@gmail.com )
R=rsc
CC=golang-dev
https://golang.org/cl/3527042
2010-12-09 10:11:57 -08:00
Robert Griesemer
f613015e0e
go ast/parser/printer: permit elision of composite literal types for composite literal elements
...
gofmt: added -s flag to simplify composite literal expressions through type elision where possible
R=rsc
CC=golang-dev
https://golang.org/cl/2319041
2010-10-22 10:03:14 -07:00