WriteProgress formats progress information from a ProgressReader.
(prog progress.Progress)
| 199 | |
| 200 | // WriteProgress formats progress information from a ProgressReader. |
| 201 | func (out *progressOutput) WriteProgress(prog progress.Progress) error { |
| 202 | formatted := out.sf.format(prog) |
| 203 | out.mu.Lock() |
| 204 | defer out.mu.Unlock() |
| 205 | _, err := out.out.Write(formatted) |
| 206 | if err != nil { |
| 207 | return err |
| 208 | } |
| 209 | |
| 210 | if out.newLines && prog.LastUpdate { |
| 211 | _, err = out.out.Write(out.sf.emptyMessage()) |
| 212 | return err |
| 213 | } |
| 214 | |
| 215 | return nil |
| 216 | } |
nothing calls this directly
no test coverage detected