]> Cypherpunks repositories - gostls13.git/commitdiff
src: gofmt -s
authorAinar Garipov <gugl.zadolbal@gmail.com>
Mon, 9 Sep 2019 06:00:53 +0000 (09:00 +0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 9 Sep 2019 18:57:05 +0000 (18:57 +0000)
Change-Id: I56d7eeaf777ac30886ee77428ca1ac72b77fbf7d
Reviewed-on: https://go-review.googlesource.com/c/go/+/193849
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/internal/objfile/goobj.go
src/cmd/internal/objfile/objfile.go
src/crypto/x509/name_constraints_test.go
src/debug/dwarf/type_test.go
src/encoding/csv/fuzz.go
src/encoding/gob/codec_test.go
src/encoding/json/encode_test.go
src/go/build/deps_test.go
src/internal/fmtsort/sort_test.go
src/os/os_windows_test.go
src/runtime/map_test.go

index 473e773ec20e714310af5dbd2e2dd9eb22872872..7c04b6d5ceea563600a3c35b18889f3c0ebd965a 100644 (file)
@@ -29,7 +29,7 @@ func openGoFile(r *os.File) (*File, error) {
        }
        rf := &goobjFile{goobj: f, f: r}
        if len(f.Native) == 0 {
-               return &File{r, []*Entry{&Entry{raw: rf}}}, nil
+               return &File{r, []*Entry{{raw: rf}}}, nil
        }
        entries := make([]*Entry, len(f.Native)+1)
        entries[0] = &Entry{
index 41c5d9b9f53cab12ad7b61bfcef5c65bbeeb66de..a58e0e159c8a5b98d0500b75aed04d3b350579c2 100644 (file)
@@ -76,7 +76,7 @@ func Open(name string) (*File, error) {
        }
        for _, try := range openers {
                if raw, err := try(r); err == nil {
-                       return &File{r, []*Entry{&Entry{raw: raw}}}, nil
+                       return &File{r, []*Entry{{raw: raw}}}, nil
                }
        }
        r.Close()
index 8344240927a89ff58b65c81370ffe9b11a75731c..5469e28de24aa18493fc9800dea85e4ea5ad5e7a 100644 (file)
@@ -1631,7 +1631,7 @@ func makeConstraintsCACert(constraints constraintsSpec, name string, key *ecdsa.
                NotAfter:              time.Unix(2000, 0),
                KeyUsage:              KeyUsageCertSign,
                BasicConstraintsValid: true,
-               IsCA: true,
+               IsCA:                  true,
        }
 
        if err := addConstraintsToTemplate(constraints, template); err != nil {
@@ -1668,7 +1668,7 @@ func makeConstraintsLeafCert(leaf leafSpec, key *ecdsa.PrivateKey, parent *Certi
                NotAfter:              time.Unix(2000, 0),
                KeyUsage:              KeyUsageDigitalSignature,
                BasicConstraintsValid: true,
-               IsCA: false,
+               IsCA:                  false,
        }
 
        for _, name := range leaf.sans {
index aa2fbeca0b3830e1b6b6eb027d6f8abd888e528f..fda03fdbb09cf22230a006747a2a80e000f11898 100644 (file)
@@ -223,7 +223,7 @@ func TestUnsupportedTypes(t *testing.T) {
                }
        }
        if dumpseen {
-               for k, _ := range seen {
+               for k := range seen {
                        fmt.Printf("seen: %s\n", k)
                }
        }
index dc33893dd74d1ad1b9e63bcc048b346d18b3eaea..8be21d5d2891d445f7e6afcddded8a098b2ad6ff 100644 (file)
@@ -17,13 +17,13 @@ func Fuzz(data []byte) int {
        buf := new(bytes.Buffer)
 
        for _, tt := range []Reader{
-               Reader{},
-               Reader{Comma: ';'},
-               Reader{Comma: '\t'},
-               Reader{LazyQuotes: true},
-               Reader{TrimLeadingSpace: true},
-               Reader{Comment: '#'},
-               Reader{Comment: ';'},
+               {},
+               {Comma: ';'},
+               {Comma: '\t'},
+               {LazyQuotes: true},
+               {TrimLeadingSpace: true},
+               {Comment: '#'},
+               {Comment: ';'},
        } {
                r := NewReader(bytes.NewReader(data))
                r.Comma = tt.Comma
index 494abc9b9131c9eb8a45af199d34c876710c5cbd..f38e88b638abbc4042d8434f667177f72735afca 100644 (file)
@@ -591,7 +591,7 @@ func TestEndToEnd(t *testing.T) {
                B:        18,
                C:        -5,
                M:        map[string]*float64{"pi": &pi, "e": &e},
-               M2:       map[int]T3{4: T3{X: pi, Z: &meaning}, 10: T3{X: e, Z: &fingers}},
+               M2:       map[int]T3{4: {X: pi, Z: &meaning}, 10: {X: e, Z: &fingers}},
                Mstring:  map[string]string{"pi": "3.14", "e": "2.71"},
                Mintptr:  map[int]*int{meaning: &fingers, fingers: &meaning},
                Mcomp:    map[complex128]complex128{comp1: comp2, comp2: comp1},
index 642f397fb95a7b9457178ff9a7dfa62d046ebe0b..daab713766c550fe902ab148fdee046f8d7a77cd 100644 (file)
@@ -796,8 +796,8 @@ func TestTextMarshalerMapKeysAreSorted(t *testing.T) {
 // https://golang.org/issue/33675
 func TestNilMarshalerTextMapKey(t *testing.T) {
        b, err := Marshal(map[*unmarshalerText]int{
-               (*unmarshalerText)(nil):    1,
-               &unmarshalerText{"A", "B"}: 2,
+               (*unmarshalerText)(nil): 1,
+               {"A", "B"}:              2,
        })
        if err != nil {
                t.Fatalf("Failed to Marshal *text.Marshaler: %v", err)
index 6b5772226ee44a566c3be573476701d097ce95c1..c914d66b4dd232ce6b4fa9c29431e82e1849ae89 100644 (file)
@@ -244,51 +244,51 @@ var pkgDeps = map[string][]string{
        "go/types":                  {"L4", "GOPARSER", "container/heap", "go/constant"},
 
        // One of a kind.
-       "archive/tar":              {"L4", "OS", "syscall", "os/user"},
-       "archive/zip":              {"L4", "OS", "compress/flate"},
-       "container/heap":           {"sort"},
-       "compress/bzip2":           {"L4"},
-       "compress/flate":           {"L4"},
-       "compress/gzip":            {"L4", "compress/flate"},
-       "compress/lzw":             {"L4"},
-       "compress/zlib":            {"L4", "compress/flate"},
-       "context":                  {"errors", "internal/reflectlite", "sync", "time"},
-       "database/sql":             {"L4", "container/list", "context", "database/sql/driver", "database/sql/internal"},
-       "database/sql/driver":      {"L4", "context", "time", "database/sql/internal"},
-       "debug/dwarf":              {"L4"},
-       "debug/elf":                {"L4", "OS", "debug/dwarf", "compress/zlib"},
-       "debug/gosym":              {"L4"},
-       "debug/macho":              {"L4", "OS", "debug/dwarf", "compress/zlib"},
-       "debug/pe":                 {"L4", "OS", "debug/dwarf", "compress/zlib"},
-       "debug/plan9obj":           {"L4", "OS"},
-       "encoding":                 {"L4"},
-       "encoding/ascii85":         {"L4"},
-       "encoding/asn1":            {"L4", "math/big"},
-       "encoding/csv":             {"L4"},
-       "encoding/gob":             {"L4", "OS", "encoding"},
-       "encoding/hex":             {"L4"},
-       "encoding/json":            {"L4", "encoding"},
-       "encoding/pem":             {"L4"},
-       "encoding/xml":             {"L4", "encoding"},
-       "flag":                     {"L4", "OS"},
-       "go/build":                 {"L4", "OS", "GOPARSER", "internal/goroot", "internal/goversion"},
-       "html":                     {"L4"},
-       "image/draw":               {"L4", "image/internal/imageutil"},
-       "image/gif":                {"L4", "compress/lzw", "image/color/palette", "image/draw"},
-       "image/internal/imageutil": {"L4"},
-       "image/jpeg":               {"L4", "image/internal/imageutil"},
-       "image/png":                {"L4", "compress/zlib"},
-       "index/suffixarray":        {"L4", "regexp"},
-       "internal/goroot":          {"L4", "OS"},
-       "internal/singleflight":    {"sync"},
-       "internal/trace":           {"L4", "OS", "container/heap"},
-       "internal/xcoff":           {"L4", "OS", "debug/dwarf"},
-       "math/big":                 {"L4"},
-       "mime":                     {"L4", "OS", "syscall", "internal/syscall/windows/registry"},
-       "mime/quotedprintable":     {"L4"},
-       "net/internal/socktest":    {"L4", "OS", "syscall", "internal/syscall/windows"},
-       "net/url":                  {"L4"},
-       "plugin":                   {"L0", "OS", "CGO"},
+       "archive/tar":                    {"L4", "OS", "syscall", "os/user"},
+       "archive/zip":                    {"L4", "OS", "compress/flate"},
+       "container/heap":                 {"sort"},
+       "compress/bzip2":                 {"L4"},
+       "compress/flate":                 {"L4"},
+       "compress/gzip":                  {"L4", "compress/flate"},
+       "compress/lzw":                   {"L4"},
+       "compress/zlib":                  {"L4", "compress/flate"},
+       "context":                        {"errors", "internal/reflectlite", "sync", "time"},
+       "database/sql":                   {"L4", "container/list", "context", "database/sql/driver", "database/sql/internal"},
+       "database/sql/driver":            {"L4", "context", "time", "database/sql/internal"},
+       "debug/dwarf":                    {"L4"},
+       "debug/elf":                      {"L4", "OS", "debug/dwarf", "compress/zlib"},
+       "debug/gosym":                    {"L4"},
+       "debug/macho":                    {"L4", "OS", "debug/dwarf", "compress/zlib"},
+       "debug/pe":                       {"L4", "OS", "debug/dwarf", "compress/zlib"},
+       "debug/plan9obj":                 {"L4", "OS"},
+       "encoding":                       {"L4"},
+       "encoding/ascii85":               {"L4"},
+       "encoding/asn1":                  {"L4", "math/big"},
+       "encoding/csv":                   {"L4"},
+       "encoding/gob":                   {"L4", "OS", "encoding"},
+       "encoding/hex":                   {"L4"},
+       "encoding/json":                  {"L4", "encoding"},
+       "encoding/pem":                   {"L4"},
+       "encoding/xml":                   {"L4", "encoding"},
+       "flag":                           {"L4", "OS"},
+       "go/build":                       {"L4", "OS", "GOPARSER", "internal/goroot", "internal/goversion"},
+       "html":                           {"L4"},
+       "image/draw":                     {"L4", "image/internal/imageutil"},
+       "image/gif":                      {"L4", "compress/lzw", "image/color/palette", "image/draw"},
+       "image/internal/imageutil":       {"L4"},
+       "image/jpeg":                     {"L4", "image/internal/imageutil"},
+       "image/png":                      {"L4", "compress/zlib"},
+       "index/suffixarray":              {"L4", "regexp"},
+       "internal/goroot":                {"L4", "OS"},
+       "internal/singleflight":          {"sync"},
+       "internal/trace":                 {"L4", "OS", "container/heap"},
+       "internal/xcoff":                 {"L4", "OS", "debug/dwarf"},
+       "math/big":                       {"L4"},
+       "mime":                           {"L4", "OS", "syscall", "internal/syscall/windows/registry"},
+       "mime/quotedprintable":           {"L4"},
+       "net/internal/socktest":          {"L4", "OS", "syscall", "internal/syscall/windows"},
+       "net/url":                        {"L4"},
+       "plugin":                         {"L0", "OS", "CGO"},
        "runtime/pprof/internal/profile": {"L4", "OS", "compress/gzip", "regexp"},
        "testing/internal/testdeps":      {"L4", "internal/testlog", "runtime/pprof", "regexp"},
        "text/scanner":                   {"L4", "OS"},
index e060d4bf5157aa4b81d5c2b27dae01dfe5c1581b..aaa0004666d51fe67b1cc6251f3437964fd07181 100644 (file)
@@ -119,7 +119,7 @@ var sortTests = []sortTest{
                "PTR0:0 PTR1:1 PTR2:2",
        },
        {
-               map[toy]string{toy{7, 2}: "72", toy{7, 1}: "71", toy{3, 4}: "34"},
+               map[toy]string{{7, 2}: "72", {7, 1}: "71", {3, 4}: "34"},
                "{3 4}:34 {7 1}:71 {7 2}:72",
        },
        {
index 2693904e5618f6ee9efafc3da89694768dfefbb2..651fe63b3fb4cfac6123d8dc0c427186377523be 100644 (file)
@@ -1183,4 +1183,4 @@ func TestMkdirDevNull(t *testing.T) {
        if errno != syscall.ENOTDIR {
                t.Fatalf("error %d is not syscall.ENOTDIR", errno)
        }
-}
\ No newline at end of file
+}
index 593e32267d41cac585ae0f8224777fe84e30c7fb..1b7ccad6ed8d3dae060f05a734e296c5232fbeaa 100644 (file)
@@ -435,11 +435,11 @@ func TestEmptyKeyAndValue(t *testing.T) {
 // ("quick keys") as well as long keys.
 func TestSingleBucketMapStringKeys_DupLen(t *testing.T) {
        testMapLookups(t, map[string]string{
-               "x":    "x1val",
-               "xx":   "x2val",
-               "foo":  "fooval",
-               "bar":  "barval", // same key length as "foo"
-               "xxxx": "x4val",
+               "x":                      "x1val",
+               "xx":                     "x2val",
+               "foo":                    "fooval",
+               "bar":                    "barval", // same key length as "foo"
+               "xxxx":                   "x4val",
                strings.Repeat("x", 128): "longval1",
                strings.Repeat("y", 128): "longval2",
        })