diffFormatWrite writes formatted diff using the [formatter.Context].
(fmtCtx formatter.Context, changes client.ContainerDiffResult)
| 23 | |
| 24 | // diffFormatWrite writes formatted diff using the [formatter.Context]. |
| 25 | func 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 | |
| 36 | type diffContext struct { |
| 37 | formatter.HeaderContext |
searching dependent graphs…