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
https://golang.org/cl/180048
diff --git a/src/pkg/net/timeout_test.go b/src/pkg/net/timeout_test.go
index c1ba399..f5ec5730 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 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) {