Commit c44a4d9
committed
cli/command/container: RunStats: avoid bytes to strings conversions
This code is using a `bytes.Buffer` to render the stats, before writing
the results to the CLI's output. Let's try to use bytes where possible
instead of converting to a string;
- Use the buffer's `Write` (and `Out().Write`) to write directly to the
buffer/writer where possible.
- Use `io.WriteString` instead of `fmt.Printf`
- Use `bytes.SplitSeq` instead of `strings.SplitSeq`
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>1 parent d92d118 commit c44a4d9
1 file changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
312 | 310 | | |
313 | 311 | | |
314 | 312 | | |
315 | | - | |
| 313 | + | |
316 | 314 | | |
317 | 315 | | |
318 | 316 | | |
| |||
339 | 337 | | |
340 | 338 | | |
341 | 339 | | |
342 | | - | |
| 340 | + | |
343 | 341 | | |
344 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
348 | 350 | | |
349 | 351 | | |
350 | | - | |
351 | | - | |
| 352 | + | |
| 353 | + | |
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
| |||
0 commit comments