Skip to content

Commit 45b2658

Browse files
ZekeLugopherbot
authored andcommitted
all: fix go vet warnings
http2/h2c/h2c_test.go:27:19: golang.org/x/net/http2.Setting composite literal uses unkeyed fields webdav/prop_test.go:152:5: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:153:5: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:191:23: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:202:23: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:217:23: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:227:23: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:241:23: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:251:23: encoding/xml.Name composite literal uses unkeyed fields webdav/prop_test.go:496:23: encoding/xml.Name composite literal uses unkeyed fields http2/transport_test.go:5310:5: call to (*T).Fatal from a non-test goroutine http2/transport_test.go:5317:5: call to (*T).Fatal from a non-test goroutine http2/transport_test.go:5660:3: unreachable code Change-Id: I8dc72b976d05dc96ae18d73660c83fc9a5584ce1 GitHub-Last-Rev: a19dcea GitHub-Pull-Request: #133 Reviewed-on: https://go-review.googlesource.com/c/net/+/406454 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Dan Kortschak <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Dan Kortschak <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 9564170 commit 45b2658

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

http2/h2c/h2c_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestSettingsAckSwallowWriter(t *testing.T) {
2424
var buf bytes.Buffer
2525
swallower := newSettingsAckSwallowWriter(bufio.NewWriter(&buf))
2626
fw := http2.NewFramer(swallower, nil)
27-
fw.WriteSettings(http2.Setting{http2.SettingMaxFrameSize, 2})
27+
fw.WriteSettings(http2.Setting{ID: http2.SettingMaxFrameSize, Val: 2})
2828
fw.WriteSettingsAck()
2929
fw.WriteData(1, true, []byte{})
3030
swallower.Flush()

http2/transport_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -5307,14 +5307,16 @@ func TestTransportFrameBufferReuse(t *testing.T) {
53075307
defer wg.Done()
53085308
req, err := http.NewRequest("POST", st.ts.URL, strings.NewReader(filler))
53095309
if err != nil {
5310-
t.Fatal(err)
5310+
t.Error(err)
5311+
return
53115312
}
53125313
req.Header.Set("Big", filler)
53135314
req.Trailer = make(http.Header)
53145315
req.Trailer.Set("Big", filler)
53155316
res, err := tr.RoundTrip(req)
53165317
if err != nil {
5317-
t.Fatal(err)
5318+
t.Error(err)
5319+
return
53185320
}
53195321
if got, want := res.StatusCode, 200; got != want {
53205322
t.Errorf("StatusCode = %v; want %v", got, want)
@@ -5657,7 +5659,6 @@ func TestTransportRetriesOnStreamProtocolError(t *testing.T) {
56575659
}
56585660
}
56595661
}
5660-
return nil
56615662
}
56625663
ct.run()
56635664
}

webdav/prop_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ func TestMemPS(t *testing.T) {
149149
op: "allprop",
150150
name: "/file",
151151
pnames: []xml.Name{
152-
{"DAV:", "resourcetype"},
153-
{"foo", "bar"},
152+
{Space: "DAV:", Local: "resourcetype"},
153+
{Space: "foo", Local: "bar"},
154154
},
155155
wantPropstats: []Propstat{{
156156
Status: http.StatusOK,
@@ -188,7 +188,7 @@ func TestMemPS(t *testing.T) {
188188
propOp: []propOp{{
189189
op: "propfind",
190190
name: "/dir",
191-
pnames: []xml.Name{{"DAV:", "resourcetype"}},
191+
pnames: []xml.Name{{Space: "DAV:", Local: "resourcetype"}},
192192
wantPropstats: []Propstat{{
193193
Status: http.StatusOK,
194194
Props: []Property{{
@@ -199,7 +199,7 @@ func TestMemPS(t *testing.T) {
199199
}, {
200200
op: "propfind",
201201
name: "/file",
202-
pnames: []xml.Name{{"DAV:", "resourcetype"}},
202+
pnames: []xml.Name{{Space: "DAV:", Local: "resourcetype"}},
203203
wantPropstats: []Propstat{{
204204
Status: http.StatusOK,
205205
Props: []Property{{
@@ -214,7 +214,7 @@ func TestMemPS(t *testing.T) {
214214
propOp: []propOp{{
215215
op: "propfind",
216216
name: "/dir",
217-
pnames: []xml.Name{{"DAV:", "getcontentlanguage"}},
217+
pnames: []xml.Name{{Space: "DAV:", Local: "getcontentlanguage"}},
218218
wantPropstats: []Propstat{{
219219
Status: http.StatusNotFound,
220220
Props: []Property{{
@@ -224,7 +224,7 @@ func TestMemPS(t *testing.T) {
224224
}, {
225225
op: "propfind",
226226
name: "/dir",
227-
pnames: []xml.Name{{"DAV:", "creationdate"}},
227+
pnames: []xml.Name{{Space: "DAV:", Local: "creationdate"}},
228228
wantPropstats: []Propstat{{
229229
Status: http.StatusNotFound,
230230
Props: []Property{{
@@ -238,7 +238,7 @@ func TestMemPS(t *testing.T) {
238238
propOp: []propOp{{
239239
op: "propfind",
240240
name: "/dir",
241-
pnames: []xml.Name{{"DAV:", "getetag"}},
241+
pnames: []xml.Name{{Space: "DAV:", Local: "getetag"}},
242242
wantPropstats: []Propstat{{
243243
Status: http.StatusNotFound,
244244
Props: []Property{{
@@ -248,7 +248,7 @@ func TestMemPS(t *testing.T) {
248248
}, {
249249
op: "propfind",
250250
name: "/file",
251-
pnames: []xml.Name{{"DAV:", "getetag"}},
251+
pnames: []xml.Name{{Space: "DAV:", Local: "getetag"}},
252252
wantPropstats: []Propstat{{
253253
Status: http.StatusOK,
254254
Props: []Property{{
@@ -493,7 +493,7 @@ func TestMemPS(t *testing.T) {
493493
propOp: []propOp{{
494494
op: "propfind",
495495
name: "/dir",
496-
pnames: []xml.Name{{"foo:", "bar"}},
496+
pnames: []xml.Name{{Space: "foo:", Local: "bar"}},
497497
wantPropstats: []Propstat{{
498498
Status: http.StatusNotFound,
499499
Props: []Property{{

0 commit comments

Comments
 (0)