mirror of
https://github.com/golang/go
synced 2024-11-13 15:10:22 -07:00
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: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
28f8f55bd2
commit
51c8d969bd
@ -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{
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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},
|
||||
|
@ -797,7 +797,7 @@ func TestTextMarshalerMapKeysAreSorted(t *testing.T) {
|
||||
func TestNilMarshalerTextMapKey(t *testing.T) {
|
||||
b, err := Marshal(map[*unmarshalerText]int{
|
||||
(*unmarshalerText)(nil): 1,
|
||||
&unmarshalerText{"A", "B"}: 2,
|
||||
{"A", "B"}: 2,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to Marshal *text.Marshaler: %v", err)
|
||||
|
@ -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",
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user