Commit 56cae1c2 authored by Robert Griesemer's avatar Robert Griesemer

all: gofmt -w -s src misc

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5781058
parent 9fb68a9a
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
package backdoor package backdoor
func LockedOSThread() bool // in runtime.c func LockedOSThread() bool // in runtime.c
...@@ -15,7 +15,7 @@ import ( ...@@ -15,7 +15,7 @@ import (
// defaultPackages specifies the Package records to be created by initHandler. // defaultPackages specifies the Package records to be created by initHandler.
var defaultPackages = []*Package{ var defaultPackages = []*Package{
&Package{Name: "Go", Kind: "go"}, {Name: "Go", Kind: "go"},
} }
// subRepos specifies the Go project sub-repositories. // subRepos specifies the Go project sub-repositories.
......
...@@ -37,7 +37,7 @@ const testPkg = "code.google.com/p/go.test" ...@@ -37,7 +37,7 @@ const testPkg = "code.google.com/p/go.test"
var testPackage = &Package{Name: "Test", Kind: "subrepo", Path: testPkg} var testPackage = &Package{Name: "Test", Kind: "subrepo", Path: testPkg}
var testPackages = []*Package{ var testPackages = []*Package{
&Package{Name: "Go", Path: ""}, {Name: "Go", Path: ""},
testPackage, testPackage,
} }
......
...@@ -143,7 +143,7 @@ func testServerScript(t *testing.T, name string, serverScript [][]byte, config * ...@@ -143,7 +143,7 @@ func testServerScript(t *testing.T, name string, serverScript [][]byte, config *
if peers != nil { if peers != nil {
gotpeers := <-pchan gotpeers := <-pchan
if len(peers) == len(gotpeers) { if len(peers) == len(gotpeers) {
for i, _ := range peers { for i := range peers {
if !peers[i].Equal(gotpeers[i]) { if !peers[i].Equal(gotpeers[i]) {
t.Fatalf("%s: mismatch on peer cert %d", name, i) t.Fatalf("%s: mismatch on peer cert %d", name, i)
} }
......
...@@ -463,48 +463,48 @@ type nullTestSpec struct { ...@@ -463,48 +463,48 @@ type nullTestSpec struct {
func TestNullStringParam(t *testing.T) { func TestNullStringParam(t *testing.T) {
spec := nullTestSpec{"nullstring", "string", [6]nullTestRow{ spec := nullTestSpec{"nullstring", "string", [6]nullTestRow{
nullTestRow{NullString{"aqua", true}, "", NullString{"aqua", true}}, {NullString{"aqua", true}, "", NullString{"aqua", true}},
nullTestRow{NullString{"brown", false}, "", NullString{"", false}}, {NullString{"brown", false}, "", NullString{"", false}},
nullTestRow{"chartreuse", "", NullString{"chartreuse", true}}, {"chartreuse", "", NullString{"chartreuse", true}},
nullTestRow{NullString{"darkred", true}, "", NullString{"darkred", true}}, {NullString{"darkred", true}, "", NullString{"darkred", true}},
nullTestRow{NullString{"eel", false}, "", NullString{"", false}}, {NullString{"eel", false}, "", NullString{"", false}},
nullTestRow{"foo", NullString{"black", false}, nil}, {"foo", NullString{"black", false}, nil},
}} }}
nullTestRun(t, spec) nullTestRun(t, spec)
} }
func TestNullInt64Param(t *testing.T) { func TestNullInt64Param(t *testing.T) {
spec := nullTestSpec{"nullint64", "int64", [6]nullTestRow{ spec := nullTestSpec{"nullint64", "int64", [6]nullTestRow{
nullTestRow{NullInt64{31, true}, 1, NullInt64{31, true}}, {NullInt64{31, true}, 1, NullInt64{31, true}},
nullTestRow{NullInt64{-22, false}, 1, NullInt64{0, false}}, {NullInt64{-22, false}, 1, NullInt64{0, false}},
nullTestRow{22, 1, NullInt64{22, true}}, {22, 1, NullInt64{22, true}},
nullTestRow{NullInt64{33, true}, 1, NullInt64{33, true}}, {NullInt64{33, true}, 1, NullInt64{33, true}},
nullTestRow{NullInt64{222, false}, 1, NullInt64{0, false}}, {NullInt64{222, false}, 1, NullInt64{0, false}},
nullTestRow{0, NullInt64{31, false}, nil}, {0, NullInt64{31, false}, nil},
}} }}
nullTestRun(t, spec) nullTestRun(t, spec)
} }
func TestNullFloat64Param(t *testing.T) { func TestNullFloat64Param(t *testing.T) {
spec := nullTestSpec{"nullfloat64", "float64", [6]nullTestRow{ spec := nullTestSpec{"nullfloat64", "float64", [6]nullTestRow{
nullTestRow{NullFloat64{31.2, true}, 1, NullFloat64{31.2, true}}, {NullFloat64{31.2, true}, 1, NullFloat64{31.2, true}},
nullTestRow{NullFloat64{13.1, false}, 1, NullFloat64{0, false}}, {NullFloat64{13.1, false}, 1, NullFloat64{0, false}},
nullTestRow{-22.9, 1, NullFloat64{-22.9, true}}, {-22.9, 1, NullFloat64{-22.9, true}},
nullTestRow{NullFloat64{33.81, true}, 1, NullFloat64{33.81, true}}, {NullFloat64{33.81, true}, 1, NullFloat64{33.81, true}},
nullTestRow{NullFloat64{222, false}, 1, NullFloat64{0, false}}, {NullFloat64{222, false}, 1, NullFloat64{0, false}},
nullTestRow{10, NullFloat64{31.2, false}, nil}, {10, NullFloat64{31.2, false}, nil},
}} }}
nullTestRun(t, spec) nullTestRun(t, spec)
} }
func TestNullBoolParam(t *testing.T) { func TestNullBoolParam(t *testing.T) {
spec := nullTestSpec{"nullbool", "bool", [6]nullTestRow{ spec := nullTestSpec{"nullbool", "bool", [6]nullTestRow{
nullTestRow{NullBool{false, true}, true, NullBool{false, true}}, {NullBool{false, true}, true, NullBool{false, true}},
nullTestRow{NullBool{true, false}, false, NullBool{false, false}}, {NullBool{true, false}, false, NullBool{false, false}},
nullTestRow{true, true, NullBool{true, true}}, {true, true, NullBool{true, true}},
nullTestRow{NullBool{true, true}, false, NullBool{true, true}}, {NullBool{true, true}, false, NullBool{true, true}},
nullTestRow{NullBool{true, false}, true, NullBool{false, false}}, {NullBool{true, false}, true, NullBool{false, false}},
nullTestRow{true, NullBool{true, false}, nil}, {true, NullBool{true, false}, nil},
}} }}
nullTestRun(t, spec) nullTestRun(t, spec)
} }
......
...@@ -694,8 +694,8 @@ type Bug3 struct { ...@@ -694,8 +694,8 @@ type Bug3 struct {
func TestGobPtrSlices(t *testing.T) { func TestGobPtrSlices(t *testing.T) {
in := []*Bug3{ in := []*Bug3{
&Bug3{1, nil}, {1, nil},
&Bug3{2, nil}, {2, nil},
} }
b := new(bytes.Buffer) b := new(bytes.Buffer)
err := NewEncoder(b).Encode(&in) err := NewEncoder(b).Encode(&in)
......
...@@ -577,7 +577,7 @@ type decompSet [4]map[string]bool ...@@ -577,7 +577,7 @@ type decompSet [4]map[string]bool
func makeDecompSet() decompSet { func makeDecompSet() decompSet {
m := decompSet{} m := decompSet{}
for i, _ := range m { for i := range m {
m[i] = make(map[string]bool) m[i] = make(map[string]bool)
} }
return m return m
...@@ -646,7 +646,7 @@ func printCharInfoTables() int { ...@@ -646,7 +646,7 @@ func printCharInfoTables() int {
fmt.Println("const (") fmt.Println("const (")
for i, m := range decompSet { for i, m := range decompSet {
sa := []string{} sa := []string{}
for s, _ := range m { for s := range m {
sa = append(sa, s) sa = append(sa, s)
} }
sort.Strings(sa) sort.Strings(sa)
......
...@@ -238,9 +238,9 @@ func TestRedirects(t *testing.T) { ...@@ -238,9 +238,9 @@ func TestRedirects(t *testing.T) {
} }
var expectedCookies = []*Cookie{ var expectedCookies = []*Cookie{
&Cookie{Name: "ChocolateChip", Value: "tasty"}, {Name: "ChocolateChip", Value: "tasty"},
&Cookie{Name: "First", Value: "Hit"}, {Name: "First", Value: "Hit"},
&Cookie{Name: "Second", Value: "Hit"}, {Name: "Second", Value: "Hit"},
} }
var echoCookiesRedirectHandler = HandlerFunc(func(w ResponseWriter, r *Request) { var echoCookiesRedirectHandler = HandlerFunc(func(w ResponseWriter, r *Request) {
......
...@@ -440,7 +440,7 @@ func TestBase(t *testing.T) { ...@@ -440,7 +440,7 @@ func TestBase(t *testing.T) {
tests := basetests tests := basetests
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
// make unix tests work on windows // make unix tests work on windows
for i, _ := range tests { for i := range tests {
tests[i].result = filepath.Clean(tests[i].result) tests[i].result = filepath.Clean(tests[i].result)
} }
// add windows specific tests // add windows specific tests
...@@ -483,7 +483,7 @@ func TestDir(t *testing.T) { ...@@ -483,7 +483,7 @@ func TestDir(t *testing.T) {
tests := dirtests tests := dirtests
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
// make unix tests work on windows // make unix tests work on windows
for i, _ := range tests { for i := range tests {
tests[i].result = filepath.Clean(tests[i].result) tests[i].result = filepath.Clean(tests[i].result)
} }
// add windows specific tests // add windows specific tests
......
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