@@ -636,8 +636,8 @@ var readResponseCloseInMiddleTests = []struct {
636
636
func TestReadResponseCloseInMiddle (t * testing.T ) {
637
637
t .Parallel ()
638
638
for _ , test := range readResponseCloseInMiddleTests {
639
- fatalf := func (format string , args ... interface {} ) {
640
- args = append ([]interface {} {test .chunked , test .compressed }, args ... )
639
+ fatalf := func (format string , args ... any ) {
640
+ args = append ([]any {test .chunked , test .compressed }, args ... )
641
641
t .Fatalf ("on test chunked=%v, compressed=%v: " + format , args ... )
642
642
}
643
643
checkErr := func (err error , msg string ) {
@@ -722,7 +722,7 @@ func TestReadResponseCloseInMiddle(t *testing.T) {
722
722
}
723
723
}
724
724
725
- func diff (t * testing.T , prefix string , have , want interface {} ) {
725
+ func diff (t * testing.T , prefix string , have , want any ) {
726
726
hv := reflect .ValueOf (have ).Elem ()
727
727
wv := reflect .ValueOf (want ).Elem ()
728
728
if hv .Type () != wv .Type () {
@@ -842,10 +842,10 @@ func TestReadResponseErrors(t *testing.T) {
842
842
name string // optional, defaults to in
843
843
in string
844
844
header Header
845
- wantErr interface {} // nil, err value, or string substring
845
+ wantErr any // nil, err value, or string substring
846
846
}
847
847
848
- status := func (s string , wantErr interface {} ) testCase {
848
+ status := func (s string , wantErr any ) testCase {
849
849
if wantErr == true {
850
850
wantErr = "malformed HTTP status code"
851
851
}
@@ -856,7 +856,7 @@ func TestReadResponseErrors(t *testing.T) {
856
856
}
857
857
}
858
858
859
- version := func (s string , wantErr interface {} ) testCase {
859
+ version := func (s string , wantErr any ) testCase {
860
860
if wantErr == true {
861
861
wantErr = "malformed HTTP version"
862
862
}
@@ -867,7 +867,7 @@ func TestReadResponseErrors(t *testing.T) {
867
867
}
868
868
}
869
869
870
- contentLength := func (status , body string , wantErr interface {} , header Header ) testCase {
870
+ contentLength := func (status , body string , wantErr any , header Header ) testCase {
871
871
return testCase {
872
872
name : fmt .Sprintf ("status %q %q" , status , body ),
873
873
in : fmt .Sprintf ("HTTP/1.1 %s\r \n %s" , status , body ),
@@ -937,7 +937,7 @@ func TestReadResponseErrors(t *testing.T) {
937
937
938
938
// wantErr can be nil, an error value to match exactly, or type string to
939
939
// match a substring.
940
- func matchErr (err error , wantErr interface {} ) error {
940
+ func matchErr (err error , wantErr any ) error {
941
941
if err == nil {
942
942
if wantErr == nil {
943
943
return nil
0 commit comments