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

Function formatWrite

cli/command/checkpoint/formatter.go:22–38  ·  view source on GitHub ↗

formatWrite writes formatted checkpoints using the Context

(fmtCtx formatter.Context, checkpoints []checkpoint.Summary)

Source from the content-addressed store, hash-verified

20
21// formatWrite writes formatted checkpoints using the Context
22func formatWrite(fmtCtx formatter.Context, checkpoints []checkpoint.Summary) error {
23 cpContext := &checkpointContext{
24 HeaderContext: formatter.HeaderContext{
25 Header: formatter.SubHeaderContext{
26 "Name": checkpointNameHeader,
27 },
28 },
29 }
30 return fmtCtx.Write(cpContext, func(format func(subContext formatter.SubContext) error) error {
31 for _, cp := range checkpoints {
32 if err := format(&checkpointContext{c: cp}); err != nil {
33 return err
34 }
35 }
36 return nil
37 })
38}
39
40type checkpointContext struct {
41 formatter.HeaderContext

Callers 2

runListFunction · 0.70

Calls 2

formatFunction · 0.85
WriteMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…