瀏覽代碼

internal/driver: fix new unkeyed composite lit vet warnings (#298)

The current version of go vet does not flag these as noted in
golang/go#23539. A fix is in the works, and will likely be included in
Go 1.11. Make the updated vet tool happy, so that the vendored copy of
pprof in the Go tree can be updated and make the vet trybot happy.

Fixes #297.
Daniel Martí 7 年之前
父節點
當前提交
37d015011a
共有 2 個檔案被更改,包括 20 行新增5 行删除
  1. 8
    2
      internal/driver/driver_test.go
  2. 12
    3
      internal/driver/webui_test.go

+ 8
- 2
internal/driver/driver_test.go 查看文件

1487
 	switch r.String() {
1487
 	switch r.String() {
1488
 	case "line[13]":
1488
 	case "line[13]":
1489
 		return []*plugin.Sym{
1489
 		return []*plugin.Sym{
1490
-			{[]string{"line1000"}, m.name, 0x1000, 0x1003},
1491
-			{[]string{"line3000"}, m.name, 0x3000, 0x3004},
1490
+			{
1491
+				Name: []string{"line1000"}, File: m.name,
1492
+				Start: 0x1000, End: 0x1003,
1493
+			},
1494
+			{
1495
+				Name: []string{"line3000"}, File: m.name,
1496
+				Start: 0x3000, End: 0x3004,
1497
+			},
1492
 		}, nil
1498
 		}, nil
1493
 	}
1499
 	}
1494
 	return nil, fmt.Errorf("unimplemented")
1500
 	return nil, fmt.Errorf("unimplemented")

+ 12
- 3
internal/driver/webui_test.go 查看文件

143
 }
143
 }
144
 func (f fakeObj) Symbols(r *regexp.Regexp, addr uint64) ([]*plugin.Sym, error) {
144
 func (f fakeObj) Symbols(r *regexp.Regexp, addr uint64) ([]*plugin.Sym, error) {
145
 	return []*plugin.Sym{
145
 	return []*plugin.Sym{
146
-		{[]string{"F1"}, fakeSource, addrBase, addrBase + 10},
147
-		{[]string{"F2"}, fakeSource, addrBase + 10, addrBase + 20},
148
-		{[]string{"F3"}, fakeSource, addrBase + 20, addrBase + 30},
146
+		{
147
+			Name: []string{"F1"}, File: fakeSource,
148
+			Start: addrBase, End: addrBase + 10,
149
+		},
150
+		{
151
+			Name: []string{"F2"}, File: fakeSource,
152
+			Start: addrBase + 10, End: addrBase + 20,
153
+		},
154
+		{
155
+			Name: []string{"F3"}, File: fakeSource,
156
+			Start: addrBase + 20, End: addrBase + 30,
157
+		},
149
 	}, nil
158
 	}, nil
150
 }
159
 }
151
 
160