MCPcopy Index your code
hub / github.com/docker/cli / diffFormatWrite

Function diffFormatWrite

cli/command/container/formatter_diff.go:25–34  ·  view source on GitHub ↗

diffFormatWrite writes formatted diff using the [formatter.Context].

(fmtCtx formatter.Context, changes client.ContainerDiffResult)

Source from the content-addressed store, hash-verified

23
24// diffFormatWrite writes formatted diff using the [formatter.Context].
25func diffFormatWrite(fmtCtx formatter.Context, changes client.ContainerDiffResult) error {
26 return fmtCtx.Write(newDiffContext(), func(format func(subContext formatter.SubContext) error) error {
27 for _, change := range changes.Changes {
28 if err := format(&diffContext{c: change}); err != nil {
29 return err
30 }
31 }
32 return nil
33 })
34}
35
36type diffContext struct {
37 formatter.HeaderContext

Callers 2

runDiffFunction · 0.85

Calls 3

newDiffContextFunction · 0.85
formatFunction · 0.85
WriteMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…