Commit d445b763 authored by Andrew Gerrand's avatar Andrew Gerrand

cmd/gofmt: document -s transformations

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/13721043
parent d237f3ce
......@@ -71,6 +71,25 @@ To remove the parentheses:
To convert the package tree from explicit slice upper bounds to implicit ones:
gofmt -r 'α[β:len(α)] -> α[β:]' -w $GOROOT/src/pkg
The simplify command
When invoked with -s gofmt will make the following source transformations where possible.
An array, slice, or map composite literal of the form:
[]T{T{}, T{}}
will be simplified to:
[]T{{}, {}}
A slice expression of the form:
s[a:len(s)]
will be simplified to:
s[a:]
A range of the form:
for x, _ = range v {...}
will be simplified to:
for x = range v {...}
*/
package main
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment