From e4bd81f903362d998f7bfc02095935408aff0bc5 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 15 Dec 2009 15:35:38 -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 3rd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180048 --- src/pkg/net/timeout_test.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/pkg/net/timeout_test.go') diff --git a/src/pkg/net/timeout_test.go b/src/pkg/net/timeout_test.go index c1ba39942..f5ec5730f 100644 --- a/src/pkg/net/timeout_test.go +++ b/src/pkg/net/timeout_test.go @@ -5,29 +5,29 @@ package net import ( - "os"; - "testing"; - "time"; + "os" + "testing" + "time" ) func testTimeout(t *testing.T, network, addr string, readFrom bool) { - fd, err := Dial(network, "", addr); - defer fd.Close(); + fd, err := Dial(network, "", addr) + defer fd.Close() if err != nil { t.Errorf("dial %s %s failed: %v", network, addr, err) } - t0 := time.Nanoseconds(); - fd.SetReadTimeout(1e8); // 100ms - var b [100]byte; - var n int; - var err1 os.Error; + t0 := time.Nanoseconds() + fd.SetReadTimeout(1e8) // 100ms + var b [100]byte + var n int + var err1 os.Error if readFrom { n, _, err1 = fd.(PacketConn).ReadFrom(&b) } else { n, err1 = fd.Read(&b) } - t1 := time.Nanoseconds(); - what := "Read"; + t1 := time.Nanoseconds() + what := "Read" if readFrom { what = "ReadFrom" } @@ -40,8 +40,8 @@ func testTimeout(t *testing.T, network, addr string, readFrom bool) { } func TestTimeoutUDP(t *testing.T) { - testTimeout(t, "udp", "127.0.0.1:53", false); - testTimeout(t, "udp", "127.0.0.1:53", true); + testTimeout(t, "udp", "127.0.0.1:53", false) + testTimeout(t, "udp", "127.0.0.1:53", true) } func TestTimeoutTCP(t *testing.T) { -- cgit v1.2.3