Commit 51c8d969 authored by Ainar Garipov's avatar Ainar Garipov Committed by Brad Fitzpatrick

src: gofmt -s

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