]> Cypherpunks repositories - gostls13.git/commitdiff
src, misc: applied gofmt -w -s
authorRobert Griesemer <gri@golang.org>
Tue, 1 Jul 2014 17:28:10 +0000 (10:28 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 1 Jul 2014 17:28:10 +0000 (10:28 -0700)
TBR=rsc
R=golang-codereviews
CC=golang-codereviews
https://golang.org/cl/111770043

src/pkg/crypto/tls/handshake_server_test.go
src/pkg/crypto/x509/x509_test.go
src/pkg/mime/multipart/example_test.go
src/pkg/net/http/serve_test.go
src/pkg/reflect/all_test.go
src/pkg/regexp/onepass.go
src/pkg/runtime/mapspeed_test.go
src/pkg/runtime/race/testdata/mop_test.go
src/pkg/runtime/string_test.go

index c3e36785b5d0fff4a0413d934b91372d12e73ab7..50eb8842c277dd31d5f8ff69d51929b7a04570f8 100644 (file)
@@ -525,7 +525,7 @@ func TestCipherSuiteCertPreferenceECDSA(t *testing.T) {
        config = *testConfig
        config.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA}
        config.Certificates = []Certificate{
-               Certificate{
+               {
                        Certificate: [][]byte{testECDSACertificate},
                        PrivateKey:  testECDSAPrivateKey,
                },
index 2fd54c78f70c3fd1a943c08cc58850d4247461c8..bac3b6c7dc0d13614c1e2238de46f92037e94ef7 100644 (file)
@@ -850,7 +850,7 @@ func TestCertificateRequestOverrides(t *testing.T) {
                // An explicit extension should override the DNSNames from the
                // template.
                ExtraExtensions: []pkix.Extension{
-                       pkix.Extension{
+                       {
                                Id:    oidExtensionSubjectAltName,
                                Value: sanContents,
                        },
@@ -868,11 +868,11 @@ func TestCertificateRequestOverrides(t *testing.T) {
        // with two extension attributes.
 
        template.Attributes = []pkix.AttributeTypeAndValueSET{
-               pkix.AttributeTypeAndValueSET{
+               {
                        Type: oidExtensionRequest,
                        Value: [][]pkix.AttributeTypeAndValue{
-                               []pkix.AttributeTypeAndValue{
-                                       pkix.AttributeTypeAndValue{
+                               {
+                                       {
                                                Type:  oidExtensionAuthorityInfoAccess,
                                                Value: []byte("foo"),
                                        },
index 26135b785817359d0e2bed024f8f33b71286f411..6d6ba81d5e659db4a9db3cd3bd7a98d09f150eb4 100644 (file)
@@ -18,7 +18,7 @@ import (
 func ExampleNewReader() {
        msg := &mail.Message{
                Header: map[string][]string{
-                       "Content-Type": []string{"multipart/mixed; boundary=foo"},
+                       "Content-Type": {"multipart/mixed; boundary=foo"},
                },
                Body: strings.NewReader(
                        "--foo\r\nFoo: one\r\n\r\nA section\r\n" +
index 8af357e2bb10f38ebaae29f0751faa1c9afa92c9..2a3fc307be8efdffa4e42c27e3aa4a138be1a182 100644 (file)
@@ -2404,13 +2404,13 @@ func TestServerConnState(t *testing.T) {
        }
 
        want := map[int][]ConnState{
-               1: []ConnState{StateNew, StateActive, StateIdle, StateActive, StateClosed},
-               2: []ConnState{StateNew, StateActive, StateIdle, StateActive, StateClosed},
-               3: []ConnState{StateNew, StateActive, StateHijacked},
-               4: []ConnState{StateNew, StateActive, StateHijacked},
-               5: []ConnState{StateNew, StateClosed},
-               6: []ConnState{StateNew, StateActive, StateClosed},
-               7: []ConnState{StateNew, StateActive, StateIdle, StateClosed},
+               1: {StateNew, StateActive, StateIdle, StateActive, StateClosed},
+               2: {StateNew, StateActive, StateIdle, StateActive, StateClosed},
+               3: {StateNew, StateActive, StateHijacked},
+               4: {StateNew, StateActive, StateHijacked},
+               5: {StateNew, StateClosed},
+               6: {StateNew, StateActive, StateClosed},
+               7: {StateNew, StateActive, StateIdle, StateClosed},
        }
        logString := func(m map[int][]ConnState) string {
                var b bytes.Buffer
index e9949012c4d58f50348ec49e02826c3e4b9782cc..f122711731748c20f39fd935d9489d7da479caa2 100644 (file)
@@ -679,7 +679,7 @@ var deepEqualTests = []DeepEqualTest{
        {1, nil, false},
        {fn1, fn3, false},
        {fn3, fn3, false},
-       {[][]int{[]int{1}}, [][]int{[]int{2}}, false},
+       {[][]int{{1}}, [][]int{{2}}, false},
 
        // Nil vs empty: not the same.
        {[]int{}, []int(nil), false},
index 501fb28af6691367d4f9d55424787ee267f8126f..7666a80ee569ced15b9fdadc6e1265d10f066adc 100644 (file)
@@ -484,7 +484,7 @@ func makeOnePass(p *onePassProg) *onePassProg {
                }
        }
        if p != notOnePass {
-               for i, _ := range p.Inst {
+               for i := range p.Inst {
                        p.Inst[i].Rune = onePassRunes[i]
                }
        }
index da45ea11e49b9ba0c8ea3d4a87d597d3c2aa130f..e44db5f101e3c8701369fb16ad427eee2916ccf6 100644 (file)
@@ -241,7 +241,7 @@ func BenchmarkMapIter(b *testing.B) {
        }
        b.ResetTimer()
        for i := 0; i < b.N; i++ {
-               for _, _ = range m {
+               for _ = range m {
                }
        }
 }
@@ -250,7 +250,7 @@ func BenchmarkMapIterEmpty(b *testing.B) {
        m := make(map[int]bool)
        b.ResetTimer()
        for i := 0; i < b.N; i++ {
-               for _, _ = range m {
+               for _ = range m {
                }
        }
 }
index 14591b184517e80abd831628ff369aba9da02850..cb17a27d37a189a219430266fc460e4bc60ba06b 100644 (file)
@@ -233,7 +233,7 @@ func TestRaceCaseFallthrough(t *testing.T) {
 
 func TestRaceCaseIssue6418(t *testing.T) {
        m := map[string]map[string]string{
-               "a": map[string]string{
+               "a": {
                        "b": "c",
                },
        }
index 9ed579235d2b36eb04e5aaaadaa3f6e0a93903a7..b05e0c7dd0e24a3a9c30bab8a54afd6d1f771672 100644 (file)
@@ -96,7 +96,7 @@ func BenchmarkRuneIterate2(b *testing.B) {
        }
        s := string(bytes)
        for i := 0; i < b.N; i++ {
-               for _, _ = range s {
+               for _ = range s {
                }
        }
 }