From 881d6064d23d9da5c7ff368bc7d41d271290deff Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 15 Dec 2009 15:27:16 -0800 Subject: 1) Change default gofmt default settings for parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 2nd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/179067 --- src/pkg/exp/iterable/array.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/pkg/exp/iterable/array.go') diff --git a/src/pkg/exp/iterable/array.go b/src/pkg/exp/iterable/array.go index 371508e5d..b5c7b5c6e 100644 --- a/src/pkg/exp/iterable/array.go +++ b/src/pkg/exp/iterable/array.go @@ -9,51 +9,51 @@ package iterable type ByteArray []byte func (a ByteArray) Iter() <-chan interface{} { - ch := make(chan interface{}); + ch := make(chan interface{}) go func() { for _, e := range a { ch <- e } - close(ch); - }(); - return ch; + close(ch) + }() + return ch } type IntArray []int func (a IntArray) Iter() <-chan interface{} { - ch := make(chan interface{}); + ch := make(chan interface{}) go func() { for _, e := range a { ch <- e } - close(ch); - }(); - return ch; + close(ch) + }() + return ch } type FloatArray []float func (a FloatArray) Iter() <-chan interface{} { - ch := make(chan interface{}); + ch := make(chan interface{}) go func() { for _, e := range a { ch <- e } - close(ch); - }(); - return ch; + close(ch) + }() + return ch } type StringArray []string func (a StringArray) Iter() <-chan interface{} { - ch := make(chan interface{}); + ch := make(chan interface{}) go func() { for _, e := range a { ch <- e } - close(ch); - }(); - return ch; + close(ch) + }() + return ch } -- cgit v1.2.3