Commit b05e677
authored
Use io.ReadCloser + json.NewDecoder (#88)
* Use io.ReadCloser + json.NewDecoder
In order to use json.NewDecoder, we have to operate on an I/O stream.
So, we swap out passing around a byteslice for this instead.
This means we can't defer closure of the body stream within the
`doRawRequest` method and have to unwrap it into individual close
statements.
But we can in the higher level `doRequest` method.
Finally, in `Repository.GetFileBlob`, we utilize `ioutil.ReadAll` to
replicate the original functionality to consume the response body.
* Restore original error message1 parent 470011f commit b05e677
2 files changed
+17
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
151 | 150 | | |
152 | 151 | | |
153 | 152 | | |
154 | | - | |
| 153 | + | |
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
| |||
301 | 300 | | |
302 | 301 | | |
303 | 302 | | |
304 | | - | |
| 303 | + | |
305 | 304 | | |
306 | 305 | | |
307 | 306 | | |
| 307 | + | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | | - | |
| 310 | + | |
312 | 311 | | |
313 | | - | |
| 312 | + | |
314 | 313 | | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
318 | 317 | | |
319 | | - | |
| 318 | + | |
320 | 319 | | |
321 | 320 | | |
322 | 321 | | |
323 | 322 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | 323 | | |
328 | 324 | | |
| 325 | + | |
329 | 326 | | |
330 | 327 | | |
331 | 328 | | |
332 | 329 | | |
| 330 | + | |
333 | 331 | | |
334 | 332 | | |
335 | 333 | | |
336 | 334 | | |
| 335 | + | |
337 | 336 | | |
338 | 337 | | |
339 | 338 | | |
340 | | - | |
| 339 | + | |
341 | 340 | | |
342 | 341 | | |
343 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
| |||
0 commit comments