]> Cypherpunks repositories - gostls13.git/commitdiff
gofmt: gofmt -s -w src misc
authorRobert Griesemer <gri@golang.org>
Wed, 13 Apr 2011 22:13:59 +0000 (15:13 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 13 Apr 2011 22:13:59 +0000 (15:13 -0700)
R=r, bradfitzwork
CC=golang-dev
https://golang.org/cl/4406044

src/cmd/godoc/format.go
src/pkg/crypto/rsa/pkcs1v15.go
src/pkg/crypto/tls/common.go
src/pkg/crypto/tls/handshake_messages_test.go
src/pkg/exp/eval/eval [new file with mode: 0755]
src/pkg/hash/fnv/fnv_test.go
src/pkg/http/export_test.go
src/pkg/os/dir_plan9.go
src/pkg/syscall/exec_windows.go
src/pkg/syscall/syscall_plan9.go

index 5d978fcf0ebad02cd08bdf1a102ce6e97cea910e..7e6470846723147296a2ce44d70e575d807a9b9e 100644 (file)
@@ -292,7 +292,7 @@ func rangeSelection(str string) Selection {
                from, _ := strconv.Atoi(m[1])
                to, _ := strconv.Atoi(m[2])
                if from < to {
-                       return makeSelection([][]int{[]int{from, to}})
+                       return makeSelection([][]int{{from, to}})
                }
        }
        return nil
index 9a7184127db0689533a87351623524ee50b75eef..3defa62ea6d36263846482808dcb1997b93e049a 100644 (file)
@@ -149,10 +149,10 @@ func nonZeroRandomBytes(s []byte, rand io.Reader) (err os.Error) {
 // precompute a prefix of the digest value that makes a valid ASN1 DER string
 // with the correct contents.
 var hashPrefixes = map[crypto.Hash][]byte{
-       crypto.MD5:       []byte{0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10},
-       crypto.SHA1:      []byte{0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14},
-       crypto.SHA256:    []byte{0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20},
-       crypto.SHA384:    []byte{0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30},
+       crypto.MD5:       {0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10},
+       crypto.SHA1:      {0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14},
+       crypto.SHA256:    {0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20},
+       crypto.SHA384:    {0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30},
        crypto.SHA512:    {0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40},
        crypto.MD5SHA1:   {}, // A special TLS case which doesn't use an ASN1 prefix.
        crypto.RIPEMD160: {0x30, 0x20, 0x30, 0x08, 0x06, 0x06, 0x28, 0xcf, 0x06, 0x03, 0x00, 0x31, 0x04, 0x14},
index c7792343942243b2614286521d41218e046897fe..fb2916ae05b63d9c5298d52354ebb4673956068f 100644 (file)
@@ -255,7 +255,7 @@ var varDefaultCipherSuites []uint16
 func initDefaultCipherSuites() {
        varDefaultCipherSuites = make([]uint16, len(cipherSuites))
        i := 0
-       for id, _ := range cipherSuites {
+       for id := range cipherSuites {
                varDefaultCipherSuites[i] = id
                i++
        }
index 0b93b89f1ad4ad152259043050a319629f6790d4..f5e94e269c30d269d56db6b62f922330839b9521 100644 (file)
@@ -121,7 +121,7 @@ func (*clientHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
        m.ocspStapling = rand.Intn(10) > 5
        m.supportedPoints = randomBytes(rand.Intn(5)+1, rand)
        m.supportedCurves = make([]uint16, rand.Intn(5)+1)
-       for i, _ := range m.supportedCurves {
+       for i := range m.supportedCurves {
                m.supportedCurves[i] = uint16(rand.Intn(30000))
        }
 
diff --git a/src/pkg/exp/eval/eval b/src/pkg/exp/eval/eval
new file mode 100755 (executable)
index 0000000..20231f2
Binary files /dev/null and b/src/pkg/exp/eval/eval differ
index 3ea3fe6f1244ac7071a91f55cc86c094233cb3b8..429230c80b4f58b8f4033da190543bf0f9f9b020 100644 (file)
@@ -154,7 +154,7 @@ func benchmark(b *testing.B, h hash.Hash) {
        b.ResetTimer()
        b.SetBytes(testDataSize)
        data := make([]byte, testDataSize)
-       for i, _ := range data {
+       for i := range data {
                data[i] = byte(i + 'a')
        }
 
index a76b70760dfa98b815b0f708f14063c1b55ae2c7..47c6877602d0ba167b67106f62c21c1bca32085b 100644 (file)
@@ -14,7 +14,7 @@ func (t *Transport) IdleConnKeysForTesting() (keys []string) {
        if t.idleConn == nil {
                return
        }
-       for key, _ := range t.idleConn {
+       for key := range t.idleConn {
                keys = append(keys, key)
        }
        return
index a53c764e382efed1ef7e955f6f0d76caa2498714..d9514191d79d2970b0a58cf3bc0c2a90173c5e25 100644 (file)
@@ -74,7 +74,7 @@ func (file *File) Readdirnames(count int) (names []string, err Error) {
        names = make([]string, len(fi))
        err = nil
 
-       for i, _ := range fi {
+       for i := range fi {
                names[i] = fi[i].Name
        }
 
index 1fa224efeaa0723b5fccbde12d6daaecda46cec8..aeee191dda7d332cf1feb6cfdd016714cb3c5926 100644 (file)
@@ -269,7 +269,7 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int,
 
        p, _ := GetCurrentProcess()
        fd := make([]int32, len(attr.Files))
-       for i, _ := range attr.Files {
+       for i := range attr.Files {
                if attr.Files[i] > 0 {
                        err := DuplicateHandle(p, int32(attr.Files[i]), p, &fd[i], 0, true, DUPLICATE_SAME_ACCESS)
                        if err != 0 {
index b889940bfc2ba7dd6174cb7ed854735a2666577e..831cbddb2466049dd8886f06c0352fe4cb5b85f9 100644 (file)
@@ -52,7 +52,7 @@ func atoi(b []byte) (n uint) {
 }
 
 func cstring(s []byte) string {
-       for i, _ := range s {
+       for i := range s {
                if s[i] == 0 {
                        return string(s[0:i])
                }