MCPcopy
hub / github.com/moby/moby / WriteProgress

Method WriteProgress

client/pkg/streamformatter/streamformatter.go:201–216  ·  view source on GitHub ↗

WriteProgress formats progress information from a ProgressReader.

(prog progress.Progress)

Source from the content-addressed store, hash-verified

199
200// WriteProgress formats progress information from a ProgressReader.
201func (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}

Callers

nothing calls this directly

Calls 5

UnlockMethod · 0.80
formatMethod · 0.65
emptyMessageMethod · 0.65
LockMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected