@@ -34,8 +34,8 @@ func TestFetch(t *testing.T) {
34
34
url : "https://httpbin.org/post" ,
35
35
opts : & fetch.Opts {
36
36
Method : "POST" ,
37
- Headers : map [string ]string {
38
- "Content-Type" : "application/json" ,
37
+ Header : map [string ][ ]string {
38
+ "Content-Type" : [] string { "application/json" } ,
39
39
},
40
40
Body : bytes .NewReader ([]byte (`{"test": "data"}` )),
41
41
},
@@ -68,8 +68,8 @@ func TestFetch(t *testing.T) {
68
68
if resp == nil {
69
69
t .Fatalf ("Expected non-nil response, but got nil" )
70
70
}
71
- if resp .Status != http .StatusOK {
72
- t .Errorf ("Expected status %d, but got %d " , http .StatusOK , resp .Status )
71
+ if resp .StatusCode != http .StatusOK {
72
+ t .Errorf ("Expected status %d, but got %v " , http .StatusOK , resp .StatusCode )
73
73
}
74
74
}
75
75
})
@@ -84,7 +84,7 @@ func TestFetchWithNilLogger(t *testing.T) {
84
84
if resp == nil {
85
85
t .Fatal ("Expected non-nil response, but got nil" )
86
86
}
87
- if resp .Status != http .StatusOK {
88
- t .Errorf ("Expected status %d, but got %d" , http .StatusOK , resp .Status )
87
+ if resp .StatusCode != http .StatusOK {
88
+ t .Errorf ("Expected status %d, but got %d" , http .StatusOK , resp .StatusCode )
89
89
}
90
90
}
0 commit comments