stackWrite writes formatted stacks using the Context
(fmtCtx formatter.Context, stacks []stackSummary)
| 17 | |
| 18 | // stackWrite writes formatted stacks using the Context |
| 19 | func stackWrite(fmtCtx formatter.Context, stacks []stackSummary) error { |
| 20 | stackCtx := &stackContext{ |
| 21 | HeaderContext: formatter.HeaderContext{ |
| 22 | Header: formatter.SubHeaderContext{ |
| 23 | "Name": formatter.NameHeader, |
| 24 | "Services": "SERVICES", |
| 25 | }, |
| 26 | }, |
| 27 | } |
| 28 | return fmtCtx.Write(stackCtx, func(format func(subContext formatter.SubContext) error) error { |
| 29 | for _, stack := range stacks { |
| 30 | if err := format(&stackContext{s: stack}); err != nil { |
| 31 | return err |
| 32 | } |
| 33 | } |
| 34 | return nil |
| 35 | }) |
| 36 | } |
| 37 | |
| 38 | type stackContext struct { |
| 39 | formatter.HeaderContext |
searching dependent graphs…