formatWrite writes formatted checkpoints using the Context
(fmtCtx formatter.Context, checkpoints []checkpoint.Summary)
| 20 | |
| 21 | // formatWrite writes formatted checkpoints using the Context |
| 22 | func 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 | |
| 40 | type checkpointContext struct { |
| 41 | formatter.HeaderContext |
searching dependent graphs…