Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/netPublic

Commit7c36036

Browse files
dmitshurgopherbot
authored andcommitted
http2, webdav, websocket: fix %q verb uses with wrong type
Caught early by the improved vet check gated behind the 1.26 languageversion combined with a tiplang builder that tests with 1.26 languageversion.Fixesgolang/go#76574.Fixesgolang/go#76599.Fixesgolang/go#76547.Change-Id: If8e2266013df0a39fc980a1e9287f8cb75949811Cq-Include-Trybots: luci.golang.try:x_net-gotip-linux-amd64-tiplangReviewed-on:https://go-review.googlesource.com/c/net/+/725220Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>Commit-Queue: Alan Donovan <adonovan@google.com>Reviewed-by: Alan Donovan <adonovan@google.com>Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>Auto-Submit: Alan Donovan <adonovan@google.com>
1 parentec11ecc commit7c36036

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

‎http2/server_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ func TestServerRejectsContentLengthWithSignNewRequests(t *testing.T) {
19771977
}
19781978
checkReq:=func(r*http.Request) {
19791979
ifr.ContentLength!=tt.wantCL {
1980-
t.Fatalf("Got: %q\nWant: %q",r.ContentLength,tt.wantCL)
1980+
t.Fatalf("Got: %d\nWant: %d",r.ContentLength,tt.wantCL)
19811981
}
19821982
}
19831983
testServerRequest(t,writeReq,checkReq)

‎webdav/prop_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ func TestMemPS(t *testing.T) {
556556
sort.Sort(byStatus(propstats))
557557
sort.Sort(byStatus(op.wantPropstats))
558558
if!reflect.DeepEqual(propstats,op.wantPropstats) {
559-
t.Errorf("%s: propstat\ngot %q\nwant %q",desc,propstats,op.wantPropstats)
559+
t.Errorf("%s: propstat\ngot %#v\nwant %#v",desc,propstats,op.wantPropstats)
560560
}
561561
}
562562
}

‎websocket/hybi_test.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Sec-WebSocket-Version: 13
190190
t.Errorf("handshake failed: %v",err)
191191
}
192192
ifcode!=http.StatusSwitchingProtocols {
193-
t.Errorf("status expected %q but got %q",http.StatusSwitchingProtocols,code)
193+
t.Errorf("status expected %d but got %d",http.StatusSwitchingProtocols,code)
194194
}
195195
expectedProtocols:= []string{"chat","superchat"}
196196
iffmt.Sprintf("%v",config.Protocol)!=fmt.Sprintf("%v",expectedProtocols) {
@@ -239,10 +239,10 @@ Sec-WebSocket-Version: 13
239239
t.Errorf("handshake failed: %v",err)
240240
}
241241
ifcode!=http.StatusSwitchingProtocols {
242-
t.Errorf("status expected %q but got %q",http.StatusSwitchingProtocols,code)
242+
t.Errorf("status expected %d but got %d",http.StatusSwitchingProtocols,code)
243243
}
244244
iflen(config.Protocol)!=0 {
245-
t.Errorf("len(config.Protocol) expected 0, but got %q",len(config.Protocol))
245+
t.Errorf("len(config.Protocol) expected 0, but got %d",len(config.Protocol))
246246
}
247247
b:=bytes.NewBuffer([]byte{})
248248
bw:=bufio.NewWriter(b)
@@ -285,7 +285,7 @@ Sec-WebSocket-Version: 9
285285
t.Errorf("handshake expected err %q but got %q",ErrBadWebSocketVersion,err)
286286
}
287287
ifcode!=http.StatusBadRequest {
288-
t.Errorf("status expected %q but got %q",http.StatusBadRequest,code)
288+
t.Errorf("status expected %d but got %d",http.StatusBadRequest,code)
289289
}
290290
}
291291

@@ -583,7 +583,7 @@ Sec-WebSocket-Version: 13
583583
t.Errorf("handshake failed: %v",err)
584584
}
585585
ifcode!=http.StatusSwitchingProtocols {
586-
t.Errorf("status expected %q but got %q",http.StatusSwitchingProtocols,code)
586+
t.Errorf("status expected %d but got %d",http.StatusSwitchingProtocols,code)
587587
}
588588
b:=bytes.NewBuffer([]byte{})
589589
bw:=bufio.NewWriter(b)

‎websocket/websocket_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func TestHTTP(t *testing.T) {
323323
return
324324
}
325325
ifresp.StatusCode!=http.StatusBadRequest {
326-
t.Errorf("Get: expected %q got %q",http.StatusBadRequest,resp.StatusCode)
326+
t.Errorf("Get: expected %d got %d",http.StatusBadRequest,resp.StatusCode)
327327
}
328328
}
329329

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp