5
5
"context"
6
6
"encoding/json"
7
7
"fmt"
8
- "io/ioutil "
8
+ "io"
9
9
"net/http"
10
10
"reflect"
11
11
"strings"
@@ -63,7 +63,7 @@ func TestSendJoinFallback(t *testing.T) {
63
63
if strings .HasPrefix (req .URL .Path , "/_matrix/federation/v2/send_join" ) {
64
64
return & http.Response {
65
65
StatusCode : 404 ,
66
- Body : ioutil .NopCloser (strings .NewReader ("404 not found" )),
66
+ Body : io .NopCloser (strings .NewReader ("404 not found" )),
67
67
}, nil
68
68
}
69
69
if ! strings .HasPrefix (req .URL .Path , "/_matrix/federation/v1/send_join" ) {
@@ -72,7 +72,7 @@ func TestSendJoinFallback(t *testing.T) {
72
72
t .Logf ("Sending response: %s" , string (v1ResBytes ))
73
73
return & http.Response {
74
74
StatusCode : 200 ,
75
- Body : ioutil .NopCloser (bytes .NewReader (v1ResBytes )),
75
+ Body : io .NopCloser (bytes .NewReader (v1ResBytes )),
76
76
}, nil
77
77
},
78
78
},
@@ -126,12 +126,12 @@ func TestSendJoinJSON(t *testing.T) {
126
126
t .Logf ("Sending response: %s" , string (respSendJoinResponseJSON ))
127
127
return & http.Response {
128
128
StatusCode : 200 ,
129
- Body : ioutil .NopCloser (bytes .NewReader (respSendJoinResponseJSON )),
129
+ Body : io .NopCloser (bytes .NewReader (respSendJoinResponseJSON )),
130
130
}, nil
131
131
}
132
132
return & http.Response {
133
133
StatusCode : 404 ,
134
- Body : ioutil .NopCloser (strings .NewReader ("404 not found" )),
134
+ Body : io .NopCloser (strings .NewReader ("404 not found" )),
135
135
}, nil
136
136
},
137
137
},
@@ -185,12 +185,12 @@ func TestSendTransactionToRelay(t *testing.T) {
185
185
if strings .HasPrefix (req .URL .Path , "/_matrix/federation/v1/send_relay" ) {
186
186
return & http.Response {
187
187
StatusCode : 200 ,
188
- Body : ioutil .NopCloser (bytes .NewReader (respSendResponseJSON )),
188
+ Body : io .NopCloser (bytes .NewReader (respSendResponseJSON )),
189
189
}, nil
190
190
}
191
191
return & http.Response {
192
192
StatusCode : 404 ,
193
- Body : ioutil .NopCloser (strings .NewReader ("404 not found" )),
193
+ Body : io .NopCloser (strings .NewReader ("404 not found" )),
194
194
}, nil
195
195
},
196
196
},
@@ -232,12 +232,12 @@ func TestSendTransactionToRelayReportsFailure(t *testing.T) {
232
232
if strings .HasPrefix (req .URL .Path , "/_matrix/federation/v1/send_relay" ) {
233
233
return & http.Response {
234
234
StatusCode : 400 ,
235
- Body : ioutil .NopCloser (bytes .NewReader (respSendResponseJSON )),
235
+ Body : io .NopCloser (bytes .NewReader (respSendResponseJSON )),
236
236
}, nil
237
237
}
238
238
return & http.Response {
239
239
StatusCode : 404 ,
240
- Body : ioutil .NopCloser (strings .NewReader ("404 not found" )),
240
+ Body : io .NopCloser (strings .NewReader ("404 not found" )),
241
241
}, nil
242
242
},
243
243
},
0 commit comments