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/debug/elf/file_test.go | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'src/pkg/debug/elf/file_test.go') diff --git a/src/pkg/debug/elf/file_test.go b/src/pkg/debug/elf/file_test.go index 9cd15fbd3..49adc4dc7 100644 --- a/src/pkg/debug/elf/file_test.go +++ b/src/pkg/debug/elf/file_test.go @@ -5,16 +5,16 @@ package elf import ( - "debug/dwarf"; - "encoding/binary"; - "reflect"; - "testing"; + "debug/dwarf" + "encoding/binary" + "reflect" + "testing" ) type fileTest struct { - file string; - hdr FileHeader; - sections []SectionHeader; + file string + hdr FileHeader + sections []SectionHeader } var fileTests = []fileTest{ @@ -101,28 +101,28 @@ var fileTests = []fileTest{ func TestOpen(t *testing.T) { for i := range fileTests { - tt := &fileTests[i]; + tt := &fileTests[i] - f, err := Open(tt.file); + f, err := Open(tt.file) if err != nil { - t.Error(err); - continue; + t.Error(err) + continue } if !reflect.DeepEqual(f.FileHeader, tt.hdr) { - t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr); - continue; + t.Errorf("open %s:\n\thave %#v\n\twant %#v\n", tt.file, f.FileHeader, tt.hdr) + continue } for i, s := range f.Sections { if i >= len(tt.sections) { break } - sh := &tt.sections[i]; + sh := &tt.sections[i] if !reflect.DeepEqual(&s.SectionHeader, sh) { t.Errorf("open %s, section %d:\n\thave %#v\n\twant %#v\n", tt.file, i, &s.SectionHeader, sh) } } - tn := len(tt.sections); - fn := len(f.Sections); + tn := len(tt.sections) + fn := len(f.Sections) if tn != fn { t.Errorf("open %s: len(Sections) = %d, want %d", tt.file, fn, tn) } @@ -130,8 +130,8 @@ func TestOpen(t *testing.T) { } type relocationTest struct { - file string; - firstEntry *dwarf.Entry; + file string + firstEntry *dwarf.Entry } var relocationTests = []relocationTest{ @@ -151,30 +151,30 @@ var relocationTests = []relocationTest{ func TestDWARFRelocations(t *testing.T) { for i, test := range relocationTests { - f, err := Open(test.file); + f, err := Open(test.file) if err != nil { - t.Error(err); - continue; + t.Error(err) + continue } - dwarf, err := f.DWARF(); + dwarf, err := f.DWARF() if err != nil { - t.Error(err); - continue; + t.Error(err) + continue } - reader := dwarf.Reader(); + reader := dwarf.Reader() // Checking only the first entry is sufficient since it has // many different strings. If the relocation had failed, all // the string offsets would be zero and all the strings would // end up being the same. - firstEntry, err := reader.Next(); + firstEntry, err := reader.Next() if err != nil { - t.Error(err); - continue; + t.Error(err) + continue } if !reflect.DeepEqual(test.firstEntry, firstEntry) { - t.Errorf("#%d: mismatch: got:%#v want:%#v", i, firstEntry, test.firstEntry); - continue; + t.Errorf("#%d: mismatch: got:%#v want:%#v", i, firstEntry, test.firstEntry) + continue } } } -- cgit v1.2.3